From 863c675e9346586327e783031554a1d0ac43bf9d Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 23 Oct 2021 13:44:25 +0200 Subject: [PATCH] Update linting tools and fix code style --- .pre-commit-config.yaml | 12 ++++++------ changes/.directory | 0 changes/34.bugfix | 1 + tasks.py | 18 +++++++++--------- tox.ini | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 changes/.directory create mode 100644 changes/34.bugfix diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30dc5aa..d8e63c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: "(.idea|node_modules|.tox)" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v4.0.1 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -17,15 +17,15 @@ repos: args: - --remove - repo: https://github.com/timothycrosley/isort - rev: "5.6.4" + rev: "5.9.3" hooks: - id: isort - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 21.9b0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.2 hooks: - id: flake8 additional_dependencies: @@ -40,14 +40,14 @@ repos: - flake8-tidy-imports - pep8-naming - repo: https://github.com/econchick/interrogate - rev: 1.3.1 + rev: 1.5.0 hooks: - id: interrogate args: - "-cpyproject.toml" - "--quiet" - repo: https://github.com/asottile/pyupgrade - rev: v2.7.3 + rev: v2.29.0 hooks: - id: pyupgrade args: diff --git a/changes/.directory b/changes/.directory new file mode 100644 index 0000000..e69de29 diff --git a/changes/34.bugfix b/changes/34.bugfix new file mode 100644 index 0000000..d652413 --- /dev/null +++ b/changes/34.bugfix @@ -0,0 +1 @@ +Update linting tools and fix code style diff --git a/tasks.py b/tasks.py index e0058ea..c58b105 100644 --- a/tasks.py +++ b/tasks.py @@ -12,7 +12,7 @@ @task def clean(c): - """ Remove artifacts and binary files. """ + """Remove artifacts and binary files.""" c.run("python setup.py clean --all") patterns = ["build", "dist"] patterns.extend(glob("*.egg*")) @@ -24,19 +24,19 @@ def clean(c): @task def lint(c): - """ Run linting tox environments. """ + """Run linting tox environments.""" c.run("tox -epep8,isort,black,pypi-description") @task # NOQA def format(c): # NOQA - """ Run code formatting tasks. """ + """Run code formatting tasks.""" c.run("tox -eblacken,isort_format") @task def towncrier_check(c): # NOQA - """ Check towncrier files. """ + """Check towncrier files.""" output = io.StringIO() c.run("git branch --contains HEAD", out_stream=output) skipped_branch_prefix = ["pull/", "develop", "master", "HEAD"] @@ -89,19 +89,19 @@ def towncrier_check(c): # NOQA @task def test(c): - """ Run test in local environment. """ + """Run test in local environment.""" c.run("python setup.py test") @task def test_all(c): - """ Run all tox environments. """ + """Run all tox environments.""" c.run("tox") @task def coverage(c): - """ Run test with coverage in local environment. """ + """Run test with coverage in local environment.""" c.run("coverage erase") c.run("run setup.py test") c.run("report -m") @@ -109,11 +109,11 @@ def coverage(c): @task def tag_release(c, level): - """ Tag release version. """ + """Tag release version.""" c.run("bumpversion --list %s --no-tag" % level) @task def tag_dev(c, level="patch"): - """ Tag development version. """ + """Tag development version.""" c.run("bumpversion --list %s --message='Bump develop version [ci skip]' --no-tag" % level) diff --git a/tox.ini b/tox.ini index 1259055..8e8fa6d 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ commands = {envpython} -minterrogate -c pyproject.toml giturlparse deps = interrogate - flake8 + flake8>3.9,<4 flake8-broken-line flake8-bugbear flake8-builtins @@ -40,7 +40,7 @@ skip_install = true [testenv:isort] commands = {envpython} -m isort -c --df giturlparse -deps = isort>5,<6 +deps = isort>5.9,<6 skip_install = true [testenv:isort_format]