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

Introduce linter (flake8) #496

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint with flake8
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install flake8
- name: Lint with flake8
run: |
make lint
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Lint requirements: flake8, autopep8, autoflake
# Run `python -m pip install autopep8 flake8 autoflake` to install them

.PHONY: lint
lint:
flake8 ./ --exclude .venv,*_pb2.py --max-line-length=150 --ignore=F403,F405,F541

.PHONY: format
format:
autopep8 --in-place --aggressive --aggressive --recursive ./ --exclude .venv,*_pb2.py --max-line-length=150
autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables ./ --exclude .venv