Skip to content

Commit

Permalink
Update flake8 configuration (#116)
Browse files Browse the repository at this point in the history
* Update flake8 configuration

* Fix flake8 issues
  • Loading branch information
wswld authored Dec 26, 2023
1 parent 82b1693 commit fd042f3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ jobs:
pip install -r requirements/test.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
flake8 ddt.py test
# # 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
run: |
pytest
4 changes: 2 additions & 2 deletions test/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def hello():
extra_attrs.sort()
assert len(extra_attrs) == 2
assert getattr(data_hello, extra_attrs[0]) == 1
assert getattr(data_hello, extra_attrs[1]) == (1,2)
assert getattr(data_hello, extra_attrs[1]) == (1, 2)


def test_file_data_decorator_with_dict():
Expand All @@ -137,7 +137,7 @@ def hello():
dh_keys = set(data_hello.__dict__.keys())
post_size = len(data_hello.__dict__)
assert post_size == pre_size + 2

extra_attrs = list(dh_keys - keys)
extra_attrs.sort()
assert len(extra_attrs) == 2
Expand Down
3 changes: 0 additions & 3 deletions test/test_named_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,3 @@ def test_missing_name_dict(self):
)
def _internal_test(value):
pass



5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ commands =
pytest --cov=ddt --cov-report html
flake8 ddt.py test
sphinx-build -b html docs docs/_build

[flake8]
max-line-length = 127
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,.tox,.venv
max-complexity = 10

0 comments on commit fd042f3

Please sign in to comment.