Test #74
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
# SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC | |
# SPDX-License-Identifier: Apache-2.0 | |
--- | |
name: Linters | |
on: | |
push: | |
branches: | |
- "**" # matches every branch | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run_linters: | |
name: Run flake8 and pylint against code tree | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code tree | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.7" | |
architecture: "x64" | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install flake8 | |
python3 -m pip install pylint | |
if [ -f requirements.txt ]; then python3 -m pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 src --count --max-complexity=10 --max-line-length=120 --statistics | |
- name: Lint with Pylint | |
env: | |
PYTHONPATH: ${{ github.workspace }}/src | |
run: | | |
pylint src | |
license-check: | |
name: Run REUSE to check license compliance | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: fsfe/reuse-action@v1 |