Compare commits
2 Commits
96eba138d2
...
6ff3e16279
Author | SHA1 | Date |
---|---|---|
Maurizio Porrato | 6ff3e16279 | |
Maurizio Porrato | db415d8f91 |
|
@ -23,6 +23,12 @@ jobs:
|
|||
uses: pdm-project/setup-pdm@v3
|
||||
- name: Install dependencies
|
||||
run: pdm install -d -G lint -G test
|
||||
- name: Run autoflake check
|
||||
run: pdm run tox -e autoflake
|
||||
- name: Run isort check
|
||||
run: pdm run tox -e isort
|
||||
- name: Run black check
|
||||
run: pdm run tox -e black
|
||||
- name: Run pylint
|
||||
run: pdm run tox -e pylint
|
||||
- name: Run mypy
|
||||
|
|
|
@ -7,6 +7,10 @@ repos:
|
|||
- id: check-toml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/PyCQA/autoflake
|
||||
rev: v2.2.0
|
||||
hooks:
|
||||
- id: autoflake
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.7.0
|
||||
hooks:
|
||||
|
|
|
@ -35,8 +35,12 @@ lint = [
|
|||
"mypy>=1.5.1",
|
||||
"bandit[toml]>=1.7.5",
|
||||
"tox-pdm>=0.6.1",
|
||||
"autoflake>=2.2.0",
|
||||
]
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
|
||||
[tool.pylint.main]
|
||||
ignore-patterns = ["^\\.#"]
|
||||
|
||||
|
@ -52,3 +56,9 @@ ignored-argument-names = "_.*|^ignored_|^unused_"
|
|||
|
||||
[tool.bandit]
|
||||
exclude_dirs = ["tests", ".tox", ".venv"]
|
||||
|
||||
[tool.autoflake]
|
||||
recursive = true
|
||||
remove-all-unused-imports=true
|
||||
remove-duplicate-keys = true
|
||||
remove-unused-variables = true
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import re
|
||||
from pathlib import Path
|
||||
from typing import Any, Union
|
||||
|
||||
|
|
28
tox.ini
28
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = pylint, mypy, bandit, py{39,310,311,py39}
|
||||
envlist = autoflake, isort, black, pylint, mypy, bandit, py{39,310,311,py39}
|
||||
isolated_build = True
|
||||
|
||||
[gh-actions]
|
||||
|
@ -14,6 +14,24 @@ groups =
|
|||
commands =
|
||||
pytest --cov-report term-missing --cov-fail-under=100 --cov=operator_repo -v tests/
|
||||
|
||||
[testenv:autoflake]
|
||||
groups =
|
||||
lint
|
||||
commands =
|
||||
autoflake --check src tests
|
||||
|
||||
[testenv:isort]
|
||||
groups =
|
||||
lint
|
||||
commands =
|
||||
isort --check src tests
|
||||
|
||||
[testenv:black]
|
||||
groups =
|
||||
lint
|
||||
commands =
|
||||
black --check src tests
|
||||
|
||||
[testenv:pylint]
|
||||
groups =
|
||||
lint
|
||||
|
@ -32,3 +50,11 @@ groups =
|
|||
lint
|
||||
commands =
|
||||
bandit -c pyproject.toml -r .
|
||||
|
||||
[testenv:format]
|
||||
groups =
|
||||
lint
|
||||
commands =
|
||||
autoflake --in-place src tests
|
||||
isort src tests
|
||||
black src tests
|
||||
|
|
Loading…
Reference in New Issue