hackingtool/.github/workflows/lint_python.yml

32 lines
1.2 KiB
YAML
Raw Normal View History

2022-06-12 21:01:25 +00:00
name: lint_python
2023-03-04 13:47:17 +00:00
on:
pull_request:
branches: [master]
push:
branches: [master]
2022-06-12 21:01:25 +00:00
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
2022-06-15 11:14:51 +00:00
with:
2023-03-04 12:25:33 +00:00
python-version: 3.x
- run: pip install --upgrade pip ruff setuptools wheel
- name: "Ruff: Show stopper (must-fix) issues"
run: ruff . --select=E9,F63,F7,F82,PLE,YTT --show-source .
- name: "Ruff: All issues"
run: ruff --exit-zero --select=ALL --statistics --target-version=py37 .
- name: "Ruff: All fixable (ruff --fix) issues"
run: ruff --exit-zero --select=ALL --ignore=ANN204,COM812,ERA001,RSE102
2023-03-04 12:33:57 +00:00
--statistics --target-version=py37 . | grep "\[\*\]"
2023-03-04 12:25:33 +00:00
- run: pip install black codespell mypy pytest safety
2022-06-12 21:01:25 +00:00
- run: black --check . || true
2023-03-04 15:02:23 +00:00
- run: codespell
2023-03-04 12:25:33 +00:00
- run: pip install -r requirements.txt || pip install --editable . || pip install . || true
2022-06-12 21:01:25 +00:00
- run: mkdir --parents --verbose .mypy_cache
2022-12-03 22:30:32 +00:00
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
2022-06-12 21:01:25 +00:00
- run: pytest . || true
- run: pytest --doctest-modules . || true
- run: safety check