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

Update linting tools and fix code style #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
Empty file added changes/.directory
Empty file.
1 change: 1 addition & 0 deletions changes/34.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update linting tools and fix code style
18 changes: 9 additions & 9 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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*"))
Expand All @@ -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"]
Expand Down Expand Up @@ -89,31 +89,31 @@ 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")


@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)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down