Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flake8 github action and fix all flake8 errors #179

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ on:
branches: [ master, next-minor-release ]

jobs:
build:
lint:
name: Linting using flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Run flake8
uses: julianwachholz/flake8-action@v2
with:
checkName: "Python Lint"
path: .
config: flake8.ini
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pytest:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -27,15 +44,9 @@ jobs:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install pytest
if [[ $PYTHON_VERSION =~ ^2\.[0-9]$ ]]; then pip install -r requirements/common.txt -r requirements/pip2.7.txt; fi
if [[ $PYTHON_VERSION =~ ^3\.[0-9]$ ]]; then pip install -r requirements/common.txt -r requirements/pip3.txt; fi
- name: Lint with flake8
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
- name: Test with pytest
env:
ONCOKB_API_TOKEN: ${{ secrets.ONCOKB_BOT_API_TOKEN }}
Expand All @@ -58,7 +69,7 @@ jobs:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install pytest
if ( $env:PYTHON_VERSION -match '^2\.[0-9]$' )
{
pip install -r requirements/common.txt -r requirements/pip2.7.txt
Expand All @@ -67,12 +78,6 @@ jobs:
{
pip install -r requirements/common.txt -r requirements/pip3.txt
}
- name: Lint with flake8
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
- name: Test with pytest
env:
ONCOKB_API_TOKEN: ${{ secrets.ONCOKB_BOT_API_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .version-level
Original file line number Diff line number Diff line change
@@ -1 +1 @@
minor
patch
Loading