[black] # black's settings are in pyproject.toml => [tool.black] [coverage:paths] source = src/ */site-packages/ [coverage:report] show_missing = true skip_covered = true skip_empty = true [coverage:run] branch = true data_file = .cache/coverage/data source = urban_meal_delivery [flake8] # Include error classes only explicitly # to avoid forward compatibility issues. select = # ============= # flake8's base # ============= # mccabe => cyclomatic complexity C901, # pycodestyle => PEP8 compliance E, W, # pyflakes => basic errors F4, F5, F6, F7, F8, F9 # ======================== # wemake-python-styleguide # Source: https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html # ======================== WPS1, WPS2, WPS3, WPS4, WPS5, WPS6, # darglint => docstring matches implementation DAR0, DAR1, DAR2, DAR3, DAR4, DAR5, # flake8-bandit => common security issues S1, S2, S3, S4, S5, S6, S7, # flake8-broken-line => no \ to end a line N400, # flake8-bugbear => opinionated bugs and design flaws B0, B3, B9, # flake8-commas => better comma placements C8, # flake8-comprehensions => better comprehensions C4, # flake8-debugger => no debugger usage T100, # flake8-docstrings => PEP257 compliance D1, D2, D3, D4, # flake8-eradicate => no commented out code E800, # flake8-isort => isort would make changes I0, # flake8-rst-docstrings => valid rst in docstrings RST2, RST3, RST4, # flake8-string-format => unify usage of str.format() P1, P2, P3, # flake8-quotes => use double quotes everywhere (complying with black) Q0, # pep8-naming N8, # ===== # other # ===== # flake8-annotations => enforce type checking for functions ANN0, ANN2, ANN3, # flake8-black => complain if black would make changes BLK1, BLK9, # flake8-expression-complexity => not too many expressions at once ECE001, # flake8-pytest-style => enforce a consistent style with pytest PT0, # By default, flake8 ignores some errors. # Instead, do not ignore anything. ignore = # If --ignore is passed on the command # line, still ignore the following: extend-ignore = # Too long line => duplicate with E501. B950, # Comply with black's style. # Source: https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8 E203, W503, WPS348, # String constant over-use is checked visually by the programmer. WPS226, # Allow underscores in numbers. WPS303, # f-strings are ok. WPS305, # Classes should not have to specify a base class. WPS306, # Putting logic into __init__.py files may be justified. WPS412, # Allow multiple assignment, e.g., x = y = 123 WPS429, per-file-ignores = docs/conf.py: # Allow shadowing built-ins and reading __*__ variables. WPS125,WPS609, migrations/env.py: # Type annotations are not strictly enforced. ANN0, ANN2, migrations/versions/*.py: # Type annotations are not strictly enforced. ANN0, ANN2, # File names of revisions are ok. WPS114,WPS118, # Revisions may have too many expressions. WPS204,WPS213, # Too many noqa's are ok. WPS402, noxfile.py: # Type annotations are not strictly enforced. ANN0, ANN2, # TODO (isort): Check if still too many module members. WPS202, # TODO (isort): Remove after simplifying the nox session "lint". WPS213, # The noxfile is rather long => allow many noqa's. WPS402, src/urban_meal_delivery/configuration.py: # Allow upper case class variables within classes. WPS115, # Numbers are normal in config files. WPS432, src/urban_meal_delivery/db/__init__.py: # Top-level of a sub-packages is intended to import a lot. F401,WPS201, src/urban_meal_delivery/db/utils/__init__.py: # Top-level of a sub-packages is intended to import a lot. F401, src/urban_meal_delivery/forecasts/__init__.py: # Top-level of a sub-packages is intended to import a lot. F401, src/urban_meal_delivery/forecasts/timify.py: # No SQL injection as the inputs come from a safe source. S608, tests/*.py: # Type annotations are not strictly enforced. ANN0, ANN2, # The `Meta` class inside the factory_boy models do not need a docstring. D106, # `assert` statements are ok in the test suite. S101, # The `random` module is not used for cryptography. S311, # Shadowing outer scopes occurs naturally with mocks. WPS442, # Test names may be longer than 40 characters. WPS118, # Modules may have many test cases. WPS202,WPS204,WPS214, # Do not check for Jones complexity in the test suite. WPS221, # We do not care about the number of "# noqa"s in the test suite. WPS402, # Allow closures. WPS430, # Numbers are normal in test cases as expected results. WPS432, # When testing, it is normal to use implementation details. WPS437, tests/db/fake_data/__init__.py: # Top-level of a sub-packages is intended to import a lot. F401,WPS201, # Explicitly set mccabe's maximum complexity to 10 as recommended by # Thomas McCabe, the inventor of the McCabe complexity, and the NIST. # Source: https://en.wikipedia.org/wiki/Cyclomatic_complexity#Limiting_complexity_during_development max-complexity = 10 # Allow more than wemake-python-styleguide's 5 local variables per function. max-local-variables = 8 # Allow more than wemake-python-styleguide's 7 methods per class. max-methods = 12 # Comply with black's style. # Source: https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length max-line-length = 88 # Preview the code lines that cause errors. show-source = true # =================================== # wemake-python-styleguide's settings # =================================== allowed-domain-names = data, obj, param, result, value, max-name-length = 40 # darglint strictness = long # flake8-docstrings docstring-convention = google # flake8-eradicate eradicate-aggressive = true # ============================== # flake8-pytest-style's settings # ============================== # Prefer @pytest.fixture over @pytest.fixture(). pytest-fixture-no-parentheses = true # Prefer @pytest.mark.parametrize(['param1', 'param2'], [(1, 2), (3, 4)]) # over @pytest.mark.parametrize(('param1', 'param2'), ([1, 2], [3, 4])) pytest-parametrize-names-type = list pytest-parametrize-values-row-type = tuple pytest-parametrize-values-type = list [isort] atomic = true case_sensitive = true combine_star = true force_alphabetical_sort_within_sections = true lines_after_imports = 2 remove_redundant_aliases = true # Comply with black's style. # Source: https://github.com/psf/black/blob/master/docs/compatible_configs.md#isort ensure_newline_before_comments = true force_grid_wrap = 0 include_trailing_comma = true line_length = 88 multi_line_output = 3 use_parentheses = true # Comply with Google's Python Style Guide. # All imports go on a single line except the ones from the typing module. # Source: https://google.github.io/styleguide/pyguide.html#313-imports-formatting force_single_line = true single_line_exclusions = typing [mypy] cache_dir = .cache/mypy [mypy-nox.*] ignore_missing_imports = true [mypy-packaging] ignore_missing_imports = true [mypy-pandas] ignore_missing_imports = true [mypy-pytest] ignore_missing_imports = true [mypy-sqlalchemy.*] ignore_missing_imports = true [mypy-utm.*] ignore_missing_imports = true [tool:pytest] addopts = --strict-markers cache_dir = .cache/pytest console_output_style = count env = TESTING=true markers = db: tests touching the database e2e: non-db integration tests