| 1 |
name: Lint |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
branches: [ "main" ] |
| 7 |
|
| 8 |
# Allows you to run this workflow manually from the Actions tab |
| 9 |
workflow_dispatch: |
| 10 |
|
| 11 |
permissions: |
| 12 |
contents: read |
| 13 |
|
| 14 |
env: |
| 15 |
PACKAGE: bpack |
| 16 |
|
| 17 |
jobs: |
| 18 |
lint: |
| 19 |
runs-on: ubuntu-latest |
| 20 |
|
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v4 |
| 23 |
|
| 24 |
- name: Set up Python |
| 25 |
uses: actions/setup-python@v5 |
| 26 |
with: |
| 27 |
python-version: "3.x" |
| 28 |
|
| 29 |
- name: Install lint dependencies |
| 30 |
shell: bash |
| 31 |
run: | |
| 32 |
python -m pip install --upgrade pip |
| 33 |
python -m pip install flake8 pydocstyle isort black |
| 34 |
if [ -f requirements-lint.txt ]; then pip install -r requirements-lint.txt; fi |
| 35 |
|
| 36 |
- name: Lint (flake8) |
| 37 |
run: | |
| 38 |
python -m flake8 --count --show-source --statistics ${PACKAGE} |
| 39 |
|
| 40 |
- name: Lint (pydocstyle) |
| 41 |
run: | |
| 42 |
python -m pydocstyle --count ${PACKAGE} |
| 43 |
|
| 44 |
- name: Lint (isort) |
| 45 |
run: | |
| 46 |
python -m isort --check ${PACKAGE} |
| 47 |
|
| 48 |
- name: Lint (black) |
| 49 |
run: | |
| 50 |
python -m black --check ${PACKAGE} |