From 3d0c0a4c8393a2038d5eddae6527f2a64fdf5d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Gmach?= Date: Thu, 24 Sep 2020 21:25:59 +0200 Subject: [PATCH 1/4] Run Flake8 via pre-commit e.g. `tox -e pre-commit` modified: .pre-commit-config.yaml modified: tox.ini --- .pre-commit-config.yaml | 14 ++++++++++++++ tox.ini | 21 --------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ec6849357..3f17530bb1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,20 @@ repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.1.0 + hooks: + - id: debug-statements - repo: https://github.com/asottile/pyupgrade rev: v2.6.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 diff --git a/tox.ini b/tox.ini index 8085ec9b57..795033defe 100644 --- a/tox.ini +++ b/tox.ini @@ -73,30 +73,9 @@ 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 From c599daa2190cc467e72a78f7f42d593626bc224a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Gmach?= Date: Thu, 24 Sep 2020 21:34:22 +0200 Subject: [PATCH 2/4] Rename `lint` env to `isort`... ... as only `isort` is currently left. modified: tox.ini --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 795033defe..9131d5afd4 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py37, py38, py39, - lint, + isort, pre-commit, coverage-report @@ -66,7 +66,7 @@ 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 From 30502ae947ab5c9e55b52eb73f3f7da2036c62d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Gmach?= Date: Thu, 24 Sep 2020 21:43:25 +0200 Subject: [PATCH 3/4] Update .travis.yml to match renamed tox env modified: .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db414f384a..fe8f44bcfc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 From 945f08b1952a5fa5c1cc7f48d4b6349fb459e023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Gmach?= Date: Thu, 24 Sep 2020 21:51:23 +0200 Subject: [PATCH 4/4] Update linters via pre-commit modified: .pre-commit-config.yaml --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f17530bb1..0c4acbe77b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 + 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]