Skip to content

Commit

Permalink
Fix Github linting and allow to run linter locally
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fersing <[email protected]>
  • Loading branch information
PierreF committed Dec 20, 2023
1 parent e5ef681 commit 4f06670
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/lint-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,5 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install bandit black codespell flake8 isort mypy pytest pyupgrade safety
- run: bandit --recursive --skip B101,B105,B106,B110,B303,B404,B603 .
- run: black --check . || true
- run: codespell || true # --ignore-words-list="" --skip=""
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- run: flake8 . --count --exit-zero --max-complexity=29 --max-line-length=167 --show-source --statistics
- run: isort --check-only --profile black .
- run: pip install -e .
- run: mypy --ignore-missing-imports . || true
- run: mv setup.cfg setup.cfg.disabled
- run: pytest .
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check
- run: pip install tox
- run: tox -e lint
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@ commands =
deps =
-rrequirements.txt
flake8<4

# This lint environment should be the same as the one in .github/work
[testenv:lint]
deps =
bandit
black
codespell
flake8
isort
mypy
pytest
pyupgrade
safety
-e .
commands =
# The "-" in front of command tells tox to ignore errors
bandit --recursive --skip B101,B105,B106,B110,B303,B404,B603,B324 src
- black --check src
- codespell
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src --count --exit-zero --max-complexity=29 --max-line-length=167 --show-source --statistics
isort --check-only --profile black src
- mypy --ignore-missing-imports src
safety check

0 comments on commit 4f06670

Please sign in to comment.