Skip to content

Commit 8216539

Browse files
committed
Adopt pre-commit hooks
Signed-off-by: Sorin Sbarnea <[email protected]>
1 parent 2229cba commit 8216539

14 files changed

+136
-74
lines changed

.idea/codeStyleSettings.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v1.3.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: mixed-line-ending
9+
- id: check-byte-order-marker
10+
- id: check-executables-have-shebangs
11+
- id: check-merge-conflict
12+
- id: check-symlinks
13+
- id: check-vcs-permalinks
14+
- id: flake8
15+
- id: debug-statements
16+
- id: requirements-txt-fixer
17+
- id: check-yaml
18+
files: .*\.(yaml|yml)$
19+
- repo: https://github.com/adrienverge/yamllint.git
20+
rev: v1.11.1
21+
hooks:
22+
- id: yamllint
23+
files: \.(yaml|yml)$

.travis.yml

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,65 @@
1+
---
12
language: python
23
cache:
3-
- pip
4-
- directories:
5-
- "node_modules"
4+
- pip
5+
- directories:
6+
- "node_modules"
67
sudo: false
78
os:
8-
- linux
9+
- linux
910
stages:
10-
- spell
11-
- docs
12-
- test
13-
- deploy
11+
- lint
12+
- docs
13+
- test
14+
- deploy
1415
script:
1516
notifications:
1617
email:
17-
18-
18+
19+
1920
jobs:
2021
include:
21-
- stage: spell
22-
script: npm install && npm run spell
23-
language: nodejs
24-
node_js:
25-
- "8"
26-
- stage: docs
27-
script: pip install -q tox-travis && python -m tox
28-
python: 2.7
29-
env: TOXENV=docs
30-
- stage: test
31-
script: pip install -q tox-travis && python -m tox
32-
python: 2.7
33-
env: TOXENV=py27
34-
after_success:
35-
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
36-
- requires.io update-site -t ac3bbcca32ae03237a6aae2b02eb9411045489bb -r
37-
- stage: test
38-
script: pip install -q tox-travis && python -m tox
39-
python: 3.4
40-
env: TOXENV=py34
41-
after_success:
42-
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
43-
- stage: test
44-
script: pip install -q tox-travis && python -m tox
45-
python: 3.5
46-
env: TOXENV=py35
47-
after_success:
48-
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
49-
- stage: test
50-
script: pip install -q tox-travis && python -m tox
51-
python: 3.6
52-
env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system'
53-
after_success:
54-
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
55-
- stage: deploy
56-
script:
57-
- export PACKAGE_NAME=$(python setup.py --name)
58-
- export PACKAGE_VERSION=$(python setup.py --version)
59-
- python setup.py sdist bdist_wheel
22+
- stage: lint
23+
script:
24+
- pip install --user --upgrade pre-commit && python -m pre_commit run
25+
- npm install && npm run spell
26+
language: nodejs
27+
node_js:
28+
- "8"
29+
- stage: docs
30+
script: pip install -q tox-travis && python -m tox
31+
python: 2.7
32+
env: TOXENV=docs
33+
- stage: test
34+
script: pip install -q tox-travis && python -m tox
35+
python: 2.7
36+
env: TOXENV=py27
37+
after_success:
38+
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
39+
- requires.io update-site -t ac3bbcca32ae03237a6aae2b02eb9411045489bb -r
40+
- stage: test
41+
script: pip install -q tox-travis && python -m tox
42+
python: 3.4
43+
env: TOXENV=py34
44+
after_success:
45+
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
46+
- stage: test
47+
script: pip install -q tox-travis && python -m tox
48+
python: 3.5
49+
env: TOXENV=py35
50+
after_success:
51+
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
52+
- stage: test
53+
script: pip install -q tox-travis && python -m tox
54+
python: 3.6
55+
env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system'
56+
after_success:
57+
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
58+
- stage: deploy
59+
script:
60+
- export PACKAGE_NAME=$(python setup.py --name)
61+
- export PACKAGE_VERSION=$(python setup.py --version)
62+
- python setup.py sdist bdist_wheel
6063
deploy:
6164
- provider: pypi
6265
user: pycontribs
@@ -83,15 +86,15 @@ deploy:
8386
api_key:
8487
secure: G19YtkGAX0aJ1oyd/7eRj1KYdsmAkjkfU2UISvsjh/68ec1+9qtPpN7BbkFYZYMjSx0BtS0SEEA7Vdl4F9DI9Zzqahbj7WzDLFe9/4aZKM/ztfKWR6CNAYaMazAKS5W7r9pPkBBDIIJ9zCqvV7FRzjewEpfTwFzwUdY+IpxEsAM=
8588
file:
86-
- dist/$PACKAGE_NAME-$PACKAGE_VERSION.tar.gz
87-
- dist/$PACKAGE_NAME-$PACKAGE_VERSION-py2.py3-none-any.whl
88-
- ChangeLog
89+
- dist/$PACKAGE_NAME-$PACKAGE_VERSION.tar.gz
90+
- dist/$PACKAGE_NAME-$PACKAGE_VERSION-py2.py3-none-any.whl
91+
- ChangeLog
8992
skip_cleanup: true
9093
on:
9194
tags: true
9295
repo: pycontribs/jira
9396
branch: master
9497
env:
9598
global:
96-
- secure: fuXwQL+KHQ96XkAFl2uQc8eK8dAjrgkup46tck/UGjVpdv1PT/yHmBKrvpFjDa50ueGbtBwTdKAwhyAmYuiZCk2IYHzdvBylCZBBji2FSpaTM59CVwgkVT6tx3HHO83X0mEX6ih9TJvZD5XhX+YUjopnseRXRq3ey3JZJXWN4RM=
97-
- secure: "pGQGM5YmHvOgaKihOyzb3k6bdqLQnZQ2OXO9QrfXlXwtop3zvZQi80Q+01l230x2psDWlwvqWTknAjAt1w463fYXPwpoSvKVCsLSSbjrf2l56nrDqnoir+n0CBy288+eIdaGEfzcxDiuULeKjlg08zrqjcjLjW0bDbBrlTXsb5U="
99+
- secure: fuXwQL+KHQ96XkAFl2uQc8eK8dAjrgkup46tck/UGjVpdv1PT/yHmBKrvpFjDa50ueGbtBwTdKAwhyAmYuiZCk2IYHzdvBylCZBBji2FSpaTM59CVwgkVT6tx3HHO83X0mEX6ih9TJvZD5XhX+YUjopnseRXRq3ey3JZJXWN4RM=
100+
- secure: "pGQGM5YmHvOgaKihOyzb3k6bdqLQnZQ2OXO9QrfXlXwtop3zvZQi80Q+01l230x2psDWlwvqWTknAjAt1w463fYXPwpoSvKVCsLSSbjrf2l56nrDqnoir+n0CBy288+eIdaGEfzcxDiuULeKjlg08zrqjcjLjW0bDbBrlTXsb5U="

.yamllint

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
braces: {max-spaces-inside: 1, level: error}
6+
brackets: {max-spaces-inside: 1, level: error}
7+
colons: {max-spaces-after: -1, level: error}
8+
commas: {max-spaces-after: -1, level: error}
9+
comments: disable
10+
comments-indentation: disable
11+
document-start: disable
12+
empty-lines: {max: 3, level: error}
13+
hyphens: {level: error}
14+
indentation:
15+
indent-sequences: consistent
16+
# spaces: consistent
17+
ignore: |
18+
/jobs/DFG
19+
# TODO: slowly fix reduce ignore pattern while fixing the errors
20+
key-duplicates: enable
21+
line-length:
22+
max: 270
23+
allow-non-breakable-words: true
24+
allow-non-breakable-inline-mappings: true
25+
new-line-at-end-of-file: disable
26+
new-lines: {type: unix}
27+
trailing-spaces: disable
28+
truthy: disable
29+
30+
ignore:
31+
.tox

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
1616
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1717
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
1818
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

codecov.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
comment:
23
layout: diff
3-
comment: false
4+
comment: false

cspell.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"version": "0.1",
33
"language": "en",
44
"words": [
5+
"Dalko",
6+
"I18NSPHINXOPTS",
7+
"TOXENV",
58
"addfinalizer",
69
"appid",
710
"atexit",
@@ -40,17 +43,14 @@
4043
"hashify",
4144
"howto",
4245
"hqi",
43-
"I18NSPHINXOPTS",
46+
"iDalko",
4447
"id",
4548
"ifeq",
4649
"ifndef",
4750
"ifneq",
4851
"igrid",
4952
"imghdr",
5053
"iname",
51-
"truthy",
52-
"untranslate",
53-
"unstaged",
5454
"incompleted",
5555
"inexistent",
5656
"instafail",
@@ -59,6 +59,8 @@
5959
"issuperset",
6060
"itil",
6161
"jira",
62+
"jirapython",
63+
"jirapythondoc",
6264
"jirashell",
6365
"jspa",
6466
"k",
@@ -101,6 +103,7 @@
101103
"reindex",
102104
"reindexing",
103105
"repo",
106+
"repos",
104107
"rnd",
105108
"rndpassword",
106109
"rrequirements",
@@ -120,23 +123,27 @@
120123
"ssbarnea",
121124
"str",
122125
"strftime",
126+
"symlinks",
123127
"test",
124128
"testenv",
125129
"testsd",
130+
"testvercomp",
126131
"tfsds",
127132
"th",
128133
"toctree",
129134
"tolower",
130-
"TOXENV",
131135
"toxinidir",
132136
"transitionid",
137+
"truthy",
133138
"trw",
134139
"twz",
135140
"txcwsb",
136141
"ucfirst",
137142
"ul",
138143
"uname",
139144
"undoc",
145+
"unstaged",
146+
"untranslate",
140147
"virtualenv",
141148
"virtualenv",
142149
"virtualenvs",
@@ -149,10 +156,6 @@
149156
"xscs",
150157
"xsrf",
151158
"yanc",
152-
"jirapythondoc",
153-
"jirapython",
154-
"testvercomp",
155-
"iDalko",
156159
"ztravisdeb"
157160
],
158161
"flagWords": [],

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributing
33
************
44

5-
The client is an open source project under the BSD license.
5+
The client is an open source project under the BSD license.
66
Contributions of any kind are welcome!
77

88
https://github.com/pycontribs/jira/

hooks/pre-commit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
22
set -e
33
python -m autopep8 --in-place jira/*.py setup.py tests/*.py examples/*.py --recursive
4-

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hacking>=0.13
66
MarkupSafe>=0.23
77
mock; python_version<'3.3'
88
oauthlib
9+
pre-commit
910
py >= 1.4
1011
pytest-cache
1112
pytest-cov

0 commit comments

Comments
 (0)