|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name: style_check |
|
|
|
|
|
on: |
|
|
push: |
|
|
branches: |
|
|
- master |
|
|
pull_request: |
|
|
branches: |
|
|
- master |
|
|
|
|
|
workflow_dispatch: |
|
|
|
|
|
concurrency: |
|
|
group: style_check-${{ github.ref }} |
|
|
cancel-in-progress: true |
|
|
|
|
|
jobs: |
|
|
style_check: |
|
|
runs-on: ${{ matrix.os }} |
|
|
strategy: |
|
|
matrix: |
|
|
os: [ubuntu-latest] |
|
|
python-version: ["3.10"] |
|
|
fail-fast: false |
|
|
|
|
|
steps: |
|
|
- uses: actions/checkout@v2 |
|
|
with: |
|
|
fetch-depth: 0 |
|
|
|
|
|
- name: Setup Python ${{ matrix.python-version }} |
|
|
uses: actions/setup-python@v1 |
|
|
with: |
|
|
python-version: ${{ matrix.python-version }} |
|
|
|
|
|
- name: Install Python dependencies |
|
|
run: | |
|
|
python3 -m pip install --upgrade pip black==22.3.0 flake8==5.0.4 click==8.1.0 isort==5.10.1 |
|
|
# Click issue fixed in https://github.com/psf/black/pull/2966 |
|
|
|
|
|
- name: Run flake8 |
|
|
shell: bash |
|
|
working-directory: ${{github.workspace}} |
|
|
run: | |
|
|
# stop the build if there are Python syntax errors or undefined names |
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 \ |
|
|
--statistics --extend-ignore=E203,E266,E501,F401,E402,F403,F841,W503 |
|
|
|
|
|
- name: Run black |
|
|
shell: bash |
|
|
working-directory: ${{github.workspace}} |
|
|
run: | |
|
|
black --check --diff . |
|
|
|
|
|
- name: Run isort |
|
|
shell: bash |
|
|
working-directory: ${{github.workspace}} |
|
|
run: | |
|
|
isort --check --diff . |
|
|
|