Skip to content

Commit

Permalink
Add python linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey-Vervoort-KNMI committed Sep 22, 2023
1 parent bd58083 commit aaf57f7
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,48 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

env:
MAX_LINE_LENGTH: 99 # TODO: would we like to increase this to 120?

jobs:
python-lint-black:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3

- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64

- name: Lint Python with Black
uses: psf/black@stable
with:
options: "--check --verbose --max-line-length=${MAX_LINE_LENGTH}"

python-lint-flake8:
runs-on: ubuntu-latest
steps:
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64

- name: Checkout Source
uses: actions/checkout@v3

- name: Install flake8
run: pip install flake8

- name: Syntax Error Check
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

- name: Code Style Check
run: flake8 . --count --max-line-length=$MAX_LINE_LENGTH --ignore=W503 --show-source --statistics

test:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit aaf57f7

Please sign in to comment.