Skip to content

Commit

Permalink
Merge pull request #35 from github/reasonable-linting
Browse files Browse the repository at this point in the history
Reasonable linting
  • Loading branch information
zkoppert committed Jun 7, 2023
2 parents 5f1804f + e1b64ac commit 96fc3aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
python -m pip install flake8 pylint pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
- name: Lint with flake8 and pylint
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
make lint
- name: Test with pytest
run: |
make test
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[MESSAGES CONTROL]
disable=
redefined-argument-from-local,
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ test:

.PHONY: clean
clean:
rm -rf .pytest_cache .coverage __pycache__
rm -rf .pytest_cache .coverage __pycache__

.PHONY: lint
lint:
pylint --rcfile=.pylintrc --fail-under=9.0 *.py
# 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

0 comments on commit 96fc3aa

Please sign in to comment.