From 842c3c1e38c2ebbfd67d02d17005113b2b544d8f Mon Sep 17 00:00:00 2001 From: Daniel Grothe Date: Mon, 14 Aug 2023 13:57:07 +0200 Subject: [PATCH] use flake8 instead of pylint add mypy to tox --- .github/workflows/static.yml | 14 ++++++++++---- .pre-commit-config.yaml | 4 ++++ dev_requirements.txt | 2 +- setup.cfg | 4 +--- tox.ini | 16 +++++++++++----- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 15389d77..0be56edd 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -8,7 +8,7 @@ on: permissions: {} jobs: - pylint: + flake8: strategy: matrix: python-version: ["3.11"] @@ -25,12 +25,18 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pylint + pip install flake8 - name: Install package run: python -m pip install -e . - - name: Analysing the code with pylint + - name: Analysing the code with flake8 run: | - pylint src + flake8 --color=never --tee --output-file=flake8-output src + - name: Upload flake8 output + uses: actions/upload-artifact@v3 + with: + name: flake8-output + path: flake8-output + if: always() mypy: strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cfcdc784..2c010100 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,3 +29,7 @@ repos: hooks: - id: black args: ["--line-length", "120"] +- repo: https://github.com/pycqa/flake8 + rev: 6.1.0 + hooks: + - id: flake8 \ No newline at end of file diff --git a/dev_requirements.txt b/dev_requirements.txt index 1e215d82..2c70a103 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -9,7 +9,7 @@ pre-commit pyupgrade black -pylint +flake8 mypy pytest diff --git a/setup.cfg b/setup.cfg index eb32ba54..88d61f3c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,10 +3,8 @@ package_dir = = src packages = find: -[pylint.master] +[flake8] max-line-length = 120 -ignore = FZJ_Decadac.py,Example_measurements.py,SET_testing.py -extension-pkg-whitelist = PyQt5 [mypy] show_error_codes = True diff --git a/tox.ini b/tox.ini index 5ac19c1d..d83f44d1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = py{39,310,311} - lint + flake8 + mypy [testenv:py{39,310,311}] deps = @@ -13,9 +14,14 @@ deps = commands = pytest --cov=src/qumada --cov-report term src/tests {posargs} -[testenv:lint] +[testenv:flake8] deps = - pylint - pylint-gitlab + flake8 commands = - pylint src {posargs} + flake8 src {posargs} + +[testenv:mypy] +deps = + mypy +commands = + mypy src {posargs}