-
Notifications
You must be signed in to change notification settings - Fork 34
44 lines (44 loc) · 1.8 KB
/
lint_python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
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@v4
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>