Merge branch 'main' into dev #799
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: lint_python | |
on: [pull_request, push] | |
jobs: | |
lint_python: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract branch name | |
shell: bash | |
# run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/}) >> $GITHUB_OUTPUT" | |
id: extract_branch | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ steps.extract_branch.outputs.branch }} | |
- uses: actions/setup-python@v4 | |
- run: pip install --upgrade pip wheel | |
- run: >- | |
pip install bandit black codespell flake8 flake8-2020 flake8-bugbear | |
flake8-comprehensions mccabe pycodestyle pyflakes mypy pytest pyupgrade safety | |
- run: bandit --recursive --skip B101,B311 . | |
- run: black --check . || true | |
- run: codespell --ignore-words-list="hass" | |
- run: >- | |
flake8 . --count --show-source --statistics | |
- run: isort --check-only --profile black . || true | |
- run: pip install -r requirements.txt || pip install --editable . || true | |
- run: mkdir --parents --verbose .mypy_cache | |
- run: >- | |
mypy --ignore-missing-imports --install-types --non-interactive . || | |
true | |
- run: pytest . || true | |
# - run: pytest --doctest-modules . || true | |
- run: shopt -s globstar && pyupgrade --py37-plus **/*.py || true | |
# Safety checks identifies issues in python packages - too much hassle. | |
# - run: safety check | |
# Not maintained: | |
# - uses: pre-commit.ci/[email protected] | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: '[Bot] lint_python - formatting updates!' | |
# commit_user_name: lint_python | |
# commit_user_email: lint_python@nill | |
# commit_author: lint_python bot <lint_python> |