Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run flake8 via pre-commit #891

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: debug-statements
- repo: https://github.com/asottile/pyupgrade
rev: v2.6.2
rev: v2.7.2
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
additional_dependencies:
- flake8-coding==1.3.2
- flake8-html==0.4.1
- flake8-deprecated==1.3
- flake8-todo==0.7
- mccabe==0.6.1
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: python
matrix:
include:
- python: "3.6"
env: TOXENV=lint
env: TOXENV=isort
after_success:
- python: "3.6"
env: TOXENV=py36
Expand Down
25 changes: 2 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ envlist =
py37,
py38,
py39,
lint,
isort,
pre-commit,
coverage-report

Expand Down Expand Up @@ -66,37 +66,16 @@ commands =
autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src setup.py
docformatter --in-place --recursive {toxinidir}/src setup.py

[testenv:lint]
[testenv:isort]
basepython = python3.6
skip_install = true

deps =
-cconstraints.txt
isort <5
flake8
# helper to generate HTML reports:
flake8-html
# Useful flake8 plugins that are Python and Plone specific:
flake8-coding
flake8-debugger
flake8-deprecated
flake8-todo
flake8-isort
mccabe
# Potential flake8 plugins that should be used: # TBD
#flake8-blind-except
#flake8-commas
#flake8-docstrings
#flake8-mypy
#flake8-pep3101
#flake8-plone-hasattr
#flake8-string-format
#flake8_strict
#flake8-quotes

commands =
- isort --check-only --recursive --diff {toxinidir}/src setup.py
flake8 src docs setup.py

[testenv:pre-commit]
basepython = python3.6
Expand Down