Skip to content

Patch 1.23.1

Patch 1.23.1 #3297

Workflow file for this run

name: CodeQuality
on:
push:
branches:
- master
- '[1-9].*.x'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ReMark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm install --global remark-cli remark-validate-links remark-lint-no-dead-urls
- run: make remark
Flake_8_syntax_errors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
# see https://github.com/marketplace/actions/pip-installer-v2
- uses: insightsengineering/pip-action@v2
with:
packages: |
flake8
- name: Run flake8
# stop the build if there are Python syntax errors or undefined names
# E9 tests are about Python syntax errors usually raised because flake8 can not build an Abstract Syntax Tree (AST). Often these issues are a sign of unused code or code that has not been ported to Python 3. These would be compile-time errors in a compiled language but in a dynamic language like Python they result in the script halting/crashing on the user.
# F63 tests are usually about the confusion between identity and equality in Python. Use ==/!= to compare str, bytes, and int literals is the classic case. These are areas where a == b is True but a is b is False (or vice versa).
# F7 tests logic errors and syntax errors in type hints
# F82 tests are almost always undefined names which are usually a sign of a typo, missing imports, or code that has not been ported to Python 3. These also would be compile-time errors in a compiled language but in Python a NameError is raised which will halt/crash the script on the user.
run: flake8 --count --select=E9,F63,F7,F82 --show-source --statistics ./src ./test_tools ./tests
Flake_8_full_report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
# see https://github.com/marketplace/actions/pip-installer-v2
- uses: insightsengineering/pip-action@v2
with:
packages: |
flake8
- name: Run flake8
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
run: flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics ./src ./test_tools ./tests
PyCodeStyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
# see https://github.com/marketplace/actions/pip-installer-v2
- uses: insightsengineering/pip-action@v2
with:
packages: |
pycodestyle
- name: Run pycodestyle
run: pycodestyle --count --max-line-length=127 --statistics --ignore=E402,E501,W503 ./src ./test_tools ./tests
PyLint-soft:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
# see https://github.com/marketplace/actions/pip-installer-v2
- uses: insightsengineering/pip-action@v2
with:
packages: |
pylint==2.15.9
- name: Get version
run: pylint --version
- name: Run pylint
run: pylint -f colorized -r y --fail-under 8.9 ./src ./test_tools ./tests
PyLint-hard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
# see https://github.com/marketplace/actions/pip-installer-v2
- uses: insightsengineering/pip-action@v2
with:
packages: |
pylint==2.15.9
- name: Get version
run: pylint --version
- name: Run pylint
run: pylint -f colorized -r y --disable=duplicate-except --disable=duplicate-code --disable=no-name-in-module --disable=too-many-lines --disable=line-too-long --disable=redefined-outer-name --disable=c-extension-no-member --disable=import-outside-toplevel --disable=too-many-locals --disable=redefined-builtin --disable=too-many-arguments --disable=wrong-import-position --disable=too-many-statements --disable=too-many-branches ./src ./test_tools ./tests
AutoPEP8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
# see https://github.com/marketplace/actions/pip-installer-v2
- uses: insightsengineering/pip-action@v2
with:
packages: |
autopep8
- name: Run autopep8
run: autopep8 --recursive --diff --aggressive --aggressive --exit-code --ignore=E402,E501,W503 ./src ./test_tools ./tests