Add pre-commit files and linting using pre-commit
This commit is contained in:
24
.pre-commit-config.yaml
Normal file
24
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/ambv/black
|
||||||
|
rev: 18.6b4
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
args: [--safe, --quiet]
|
||||||
|
language_version: python3.6
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v1.3.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: debug-statements
|
||||||
|
- id: flake8
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: rst
|
||||||
|
name: rst
|
||||||
|
entry: rst-lint --encoding utf-8
|
||||||
|
files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|changelog/.*)$
|
||||||
|
language: python
|
||||||
|
additional_dependencies: [pygments, restructuredtext_lint]
|
||||||
|
python_version: python3.6
|
||||||
@@ -25,12 +25,17 @@ install: pip install tox setuptools_scm
|
|||||||
script: tox
|
script: tox
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- linting
|
||||||
- test
|
- test
|
||||||
- name: deploy
|
- name: deploy
|
||||||
if: repo = pytest-dev/pytest-xdist AND tag IS present
|
if: repo = pytest-dev/pytest-xdist AND tag IS present
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
- stage: linting
|
||||||
|
python: '3.6'
|
||||||
|
script:
|
||||||
|
- tox -e linting
|
||||||
- stage: test
|
- stage: test
|
||||||
# python x env above are already included into this stage
|
# python x env above are already included into this stage
|
||||||
- python: "2.7"
|
- python: "2.7"
|
||||||
|
|||||||
16
tox.ini
16
tox.ini
@@ -1,11 +1,10 @@
|
|||||||
[tox]
|
[tox]
|
||||||
# if you change the envlist, please update .travis.yml file as well
|
# if you change the envlist, please update .travis.yml file as well
|
||||||
envlist=
|
envlist=
|
||||||
|
linting
|
||||||
py{27,34,35,36}-pytest{34,35,36}
|
py{27,34,35,36}-pytest{34,35,36}
|
||||||
py{27,36}-pytest36-pexpect
|
py{27,36}-pytest36-pexpect
|
||||||
py{27,36}-pytest{master,features}
|
py{27,36}-pytest{master,features}
|
||||||
flakes
|
|
||||||
readme
|
|
||||||
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
@@ -28,16 +27,11 @@ commands=
|
|||||||
py.cleanup -aq
|
py.cleanup -aq
|
||||||
pytest {posargs}
|
pytest {posargs}
|
||||||
|
|
||||||
[testenv:flakes]
|
[testenv:linting]
|
||||||
changedir=
|
changedir=
|
||||||
deps = flake8
|
deps =
|
||||||
commands = flake8 setup.py testing xdist
|
pre-commit
|
||||||
|
commands = pre-commit run --all
|
||||||
[testenv:readme]
|
|
||||||
changedir =
|
|
||||||
deps = readme
|
|
||||||
skip_install = true
|
|
||||||
commands = python setup.py check -r -s
|
|
||||||
|
|
||||||
[testenv:release]
|
[testenv:release]
|
||||||
changedir=
|
changedir=
|
||||||
|
|||||||
Reference in New Issue
Block a user