Skip to content

Commit

Permalink
Adopt pre-commit hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
ssbarnea committed Jun 21, 2018
1 parent 2229cba commit 8216539
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-vcs-permalinks
- id: flake8
- id: debug-statements
- id: requirements-txt-fixer
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.11.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
111 changes: 57 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
---
language: python
cache:
- pip
- directories:
- "node_modules"
- pip
- directories:
- "node_modules"
sudo: false
os:
- linux
- linux
stages:
- spell
- docs
- test
- deploy
- lint
- docs
- test
- deploy
script:
notifications:
email:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
jobs:
include:
- stage: spell
script: npm install && npm run spell
language: nodejs
node_js:
- "8"
- stage: docs
script: pip install -q tox-travis && python -m tox
python: 2.7
env: TOXENV=docs
- stage: test
script: pip install -q tox-travis && python -m tox
python: 2.7
env: TOXENV=py27
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- requires.io update-site -t ac3bbcca32ae03237a6aae2b02eb9411045489bb -r
- stage: test
script: pip install -q tox-travis && python -m tox
python: 3.4
env: TOXENV=py34
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- stage: test
script: pip install -q tox-travis && python -m tox
python: 3.5
env: TOXENV=py35
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- stage: test
script: pip install -q tox-travis && python -m tox
python: 3.6
env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system'
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- stage: deploy
script:
- export PACKAGE_NAME=$(python setup.py --name)
- export PACKAGE_VERSION=$(python setup.py --version)
- python setup.py sdist bdist_wheel
- stage: lint
script:
- pip install --user --upgrade pre-commit && python -m pre_commit run
- npm install && npm run spell
language: nodejs
node_js:
- "8"
- stage: docs
script: pip install -q tox-travis && python -m tox
python: 2.7
env: TOXENV=docs
- stage: test
script: pip install -q tox-travis && python -m tox
python: 2.7
env: TOXENV=py27
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- requires.io update-site -t ac3bbcca32ae03237a6aae2b02eb9411045489bb -r
- stage: test
script: pip install -q tox-travis && python -m tox
python: 3.4
env: TOXENV=py34
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- stage: test
script: pip install -q tox-travis && python -m tox
python: 3.5
env: TOXENV=py35
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- stage: test
script: pip install -q tox-travis && python -m tox
python: 3.6
env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system'
after_success:
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
- stage: deploy
script:
- export PACKAGE_NAME=$(python setup.py --name)
- export PACKAGE_VERSION=$(python setup.py --version)
- python setup.py sdist bdist_wheel
deploy:
- provider: pypi
user: pycontribs
Expand All @@ -83,15 +86,15 @@ deploy:
api_key:
secure: G19YtkGAX0aJ1oyd/7eRj1KYdsmAkjkfU2UISvsjh/68ec1+9qtPpN7BbkFYZYMjSx0BtS0SEEA7Vdl4F9DI9Zzqahbj7WzDLFe9/4aZKM/ztfKWR6CNAYaMazAKS5W7r9pPkBBDIIJ9zCqvV7FRzjewEpfTwFzwUdY+IpxEsAM=
file:
- dist/$PACKAGE_NAME-$PACKAGE_VERSION.tar.gz
- dist/$PACKAGE_NAME-$PACKAGE_VERSION-py2.py3-none-any.whl
- ChangeLog
- dist/$PACKAGE_NAME-$PACKAGE_VERSION.tar.gz
- dist/$PACKAGE_NAME-$PACKAGE_VERSION-py2.py3-none-any.whl
- ChangeLog
skip_cleanup: true
on:
tags: true
repo: pycontribs/jira
branch: master
env:
global:
- secure: fuXwQL+KHQ96XkAFl2uQc8eK8dAjrgkup46tck/UGjVpdv1PT/yHmBKrvpFjDa50ueGbtBwTdKAwhyAmYuiZCk2IYHzdvBylCZBBji2FSpaTM59CVwgkVT6tx3HHO83X0mEX6ih9TJvZD5XhX+YUjopnseRXRq3ey3JZJXWN4RM=
- secure: "pGQGM5YmHvOgaKihOyzb3k6bdqLQnZQ2OXO9QrfXlXwtop3zvZQi80Q+01l230x2psDWlwvqWTknAjAt1w463fYXPwpoSvKVCsLSSbjrf2l56nrDqnoir+n0CBy288+eIdaGEfzcxDiuULeKjlg08zrqjcjLjW0bDbBrlTXsb5U="
- secure: fuXwQL+KHQ96XkAFl2uQc8eK8dAjrgkup46tck/UGjVpdv1PT/yHmBKrvpFjDa50ueGbtBwTdKAwhyAmYuiZCk2IYHzdvBylCZBBji2FSpaTM59CVwgkVT6tx3HHO83X0mEX6ih9TJvZD5XhX+YUjopnseRXRq3ey3JZJXWN4RM=
- secure: "pGQGM5YmHvOgaKihOyzb3k6bdqLQnZQ2OXO9QrfXlXwtop3zvZQi80Q+01l230x2psDWlwvqWTknAjAt1w463fYXPwpoSvKVCsLSSbjrf2l56nrDqnoir+n0CBy288+eIdaGEfzcxDiuULeKjlg08zrqjcjLjW0bDbBrlTXsb5U="
31 changes: 31 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
extends: default

rules:
braces: {max-spaces-inside: 1, level: error}
brackets: {max-spaces-inside: 1, level: error}
colons: {max-spaces-after: -1, level: error}
commas: {max-spaces-after: -1, level: error}
comments: disable
comments-indentation: disable
document-start: disable
empty-lines: {max: 3, level: error}
hyphens: {level: error}
indentation:
indent-sequences: consistent
# spaces: consistent
ignore: |
/jobs/DFG
# TODO: slowly fix reduce ignore pattern while fixing the errors
key-duplicates: enable
line-length:
max: 270
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file: disable
new-lines: {type: unix}
trailing-spaces: disable
truthy: disable

ignore:
.tox
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 2 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
comment:
layout: diff
comment: false
comment: false
21 changes: 12 additions & 9 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"version": "0.1",
"language": "en",
"words": [
"Dalko",
"I18NSPHINXOPTS",
"TOXENV",
"addfinalizer",
"appid",
"atexit",
Expand Down Expand Up @@ -40,17 +43,14 @@
"hashify",
"howto",
"hqi",
"I18NSPHINXOPTS",
"iDalko",
"id",
"ifeq",
"ifndef",
"ifneq",
"igrid",
"imghdr",
"iname",
"truthy",
"untranslate",
"unstaged",
"incompleted",
"inexistent",
"instafail",
Expand All @@ -59,6 +59,8 @@
"issuperset",
"itil",
"jira",
"jirapython",
"jirapythondoc",
"jirashell",
"jspa",
"k",
Expand Down Expand Up @@ -101,6 +103,7 @@
"reindex",
"reindexing",
"repo",
"repos",
"rnd",
"rndpassword",
"rrequirements",
Expand All @@ -120,23 +123,27 @@
"ssbarnea",
"str",
"strftime",
"symlinks",
"test",
"testenv",
"testsd",
"testvercomp",
"tfsds",
"th",
"toctree",
"tolower",
"TOXENV",
"toxinidir",
"transitionid",
"truthy",
"trw",
"twz",
"txcwsb",
"ucfirst",
"ul",
"uname",
"undoc",
"unstaged",
"untranslate",
"virtualenv",
"virtualenv",
"virtualenvs",
Expand All @@ -149,10 +156,6 @@
"xscs",
"xsrf",
"yanc",
"jirapythondoc",
"jirapython",
"testvercomp",
"iDalko",
"ztravisdeb"
],
"flagWords": [],
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributing
************

The client is an open source project under the BSD license.
The client is an open source project under the BSD license.
Contributions of any kind are welcome!

https://github.com/pycontribs/jira/
Expand Down
1 change: 0 additions & 1 deletion hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
set -e
python -m autopep8 --in-place jira/*.py setup.py tests/*.py examples/*.py --recursive

1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ hacking>=0.13
MarkupSafe>=0.23
mock; python_version<'3.3'
oauthlib
pre-commit
py >= 1.4
pytest-cache
pytest-cov
Expand Down
3 changes: 1 addition & 2 deletions requirements-opt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.

filemagic>=1.6
PyJWT
requests_jwt
requests_kerberos
filemagic>=1.6
flake8
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author-email = [email protected]
maintainer = Sorin Sbarnea
maintainer-email = [email protected]
summary = Python library for interacting with JIRA via REST APIs.
description-file =
description-file =
README.rst
# Do not include ChangeLog in description-file due to multiple reasons:
# - Unicode chars, see https://github.com/pycontribs/jira/issues/512
Expand Down
1 change: 0 additions & 1 deletion tests/stop-jira.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
set -ex
kill $(ps -o pid,command|grep atlassian-plugin-sdk|grep java|awk '{print $1}')
#ps -o pid,command|grep atlassian-plugin-sdk|grep java|awk '{kill -9 $1;}'

7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 2.3.1
envlist = py27,py34,py35,py36,docs
envlist = lint,py27,py34,py35,py36,docs
skip_missing_interpreters = true

[testenv:docs]
Expand All @@ -23,7 +23,6 @@ extras =
sitepackages=False
commands=
python -m pip check
python -m flake8
python -m pytest {posargs}
passenv =
CI
Expand All @@ -35,3 +34,7 @@ envars =
PIP_DISABLE_PIP_VERSON_CHECK=1
whitelist_externals =
bash

[testenv:lint]
commands=
pre-commit run --all

0 comments on commit 8216539

Please sign in to comment.