diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d37c285..be6bec2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,5 +21,8 @@ jobs: - name: run tests run: python -mpytest + - name: lint + run: python -mflake8 + ... - \ No newline at end of file + diff --git a/oai_status/__init__.py b/oai_status/__init__.py index a12936d..5eb8832 100644 --- a/oai_status/__init__.py +++ b/oai_status/__init__.py @@ -16,7 +16,7 @@ def list_sets(base_url: str = 'https://oai.sbb.berlin/') -> bool: """ try: assert Document(f'{base_url}?verb=ListSets').xpath('//ListSets/set/setSpec') - except: + except BaseException: return False return True diff --git a/pyproject.toml b/pyproject.toml index 85b78b2..7415c8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,10 @@ dependencies = [ [project.optional-dependencies] dev = [ - 'pytest-cov' + 'pytest-cov', + 'flake8-multiline-containers', + 'flake8-pyproject', + 'flake8-simplify', ] [tool.setuptools] @@ -23,7 +26,20 @@ packages = [ oai-status = 'oai_status:main' oai-list-records = 'oai_status.list_records:main' + [tool.pytest.ini_options] addopts = ''' --doctest-modules --cov-report=term-missing --cov=oai_status/ ''' + + +[tool.coverage.report] +fail_under = 96 +precision = 2 + + +[tool.flake8] +max-line-length = 100 +exclude = [ + 'build', '.venv' +]