Skip to content

Commit

Permalink
Move lint to pre-commit.
Browse files Browse the repository at this point in the history
Removed things from .meta.toml still need to be added to meta/config.
  • Loading branch information
icemac committed Aug 19, 2024
1 parent 97d112b commit 59e4f70
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 63 deletions.
24 changes: 0 additions & 24 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ testenv-deps = [
"universal2: MarkupSafe",
"universal2: zope.testrunner",
]
additional-envlist = [
"pre-commit",
]
testenv-commands-pre = [
"{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:root-directory={toxinidir}",
]
Expand All @@ -64,27 +61,6 @@ testenv-commands = [
coverage-command = "coverage run {envdir}/bin/alltests {posargs:-vc}"
testenv-additional = [
"allowlist_externals = *",
"",
"[testenv:pre-commit]",
"basepython = python3",
"description = This env runs all linters configured in .pre-commit-config.yaml",
"skip_install = true",
"deps =",
" pre-commit",
"commands_pre =",
"commands =",
" pre-commit run --all-files --show-diff-on-failure",
"",
"[testenv:autopep8]",
"basepython = python3.8",
"skip_install = true",
"deps =",
" -cconstraints.txt",
" autopep8",
" docformatter",
"commands =",
" autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src setup.py",
" docformatter --in-place --recursive {toxinidir}/src setup.py",
]
use-flake8 = true

Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ repos:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/PyCQA/flake8
rev: "6.1.0"
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies:
- flake8-coding == 1.3.2
- flake8-debugger == 4.1.2
38 changes: 1 addition & 37 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ envlist =
py313
docs
coverage
pre-commit

[testenv]
skip_install = true
Expand Down Expand Up @@ -51,7 +50,7 @@ commands =
!universal2: {envdir}/bin/alltests --layer '!Products.PluginIndexes' {posargs:-vc}
allowlist_externals = *

[testenv:pre-commit]
[testenv:lint]
basepython = python3
description = This env runs all linters configured in .pre-commit-config.yaml
skip_install = true
Expand All @@ -61,17 +60,6 @@ commands_pre =
commands =
pre-commit run --all-files --show-diff-on-failure

[testenv:autopep8]
basepython = python3.8
skip_install = true
deps =
-cconstraints.txt
autopep8
docformatter
commands =
autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src setup.py
docformatter --in-place --recursive {toxinidir}/src setup.py

[testenv:release-check]
description = ensure that the distribution is ready to release
basepython = python3
Expand All @@ -89,30 +77,6 @@ commands =
python -m build --sdist --no-isolation
twine check dist/*

[testenv:lint]
basepython = python3
commands_pre =
mkdir -p {toxinidir}/parts/flake8
allowlist_externals =
mkdir
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 {toxinidir}/src {toxinidir}/setup.py
deps =
flake8
isort
# Useful flake8 plugins that are Python and Plone specific:
flake8-coding
flake8-debugger
mccabe

[testenv:isort-apply]
basepython = python3
commands_pre =
deps =
isort
commands =
isort {toxinidir}/src {toxinidir}/setup.py []

[testenv:docs]
basepython = python3
Expand Down

0 comments on commit 59e4f70

Please sign in to comment.