[flake8]

# Don't even try to analyze these:
exclude =
  # No need to traverse egg files
  *.egg,
  # No need to traverse egg info dir
  *.egg-info,
  # No need to traverse eggs directory
  .eggs,
  # No need to traverse our git directory
  .git,
  # GitHub configs
  .github,
  # Cache files of MyPy
  .mypy_cache,
  # Cache files of pytest
  .pytest_cache,
  # Temp dir of pytest-testmon
  .tmontmp,
  # Countless third-party libs in venvs
  .tox,
  # Occasional virtualenv dir
  .venv,
  # VS Code
  .vscode,
  # There's no value in checking cache directories
  __pycache__,
  # Temporary build dir
  build,
  # This contains sdists and wheels of pylibsshext that we don't want to check
  dist,
  # Metadata of `pip wheel` cmd is autogenerated
  pip-wheel-metadata,

# IMPORTANT: avoid using ignore option, always use extend-ignore instead
# Completely and unconditionally ignore the following errors:
extend-ignore =
  E501,  # "line too long", its function is replaced by `flake8-length`
  W505,  # "doc line too long", its function is replaced by `flake8-length`
  I  # flake8-isort is drunk + we have isort integrated into pre-commit
  S101,  # MyPy requires `asserts`, plus they're not bad if cooked well
  WPS300  # local folder imports are needed
  WPS305  # this extension is Python 3 only and so f-strings are allowed
  WPS317
  WPS318  # WPS317/WPS318 enforces weird indents
  WPS326  # doesn't allow implicit string concat

# IMPORTANT: avoid using select option, always use select-ignore instead
# Enable the following errors:
extend-select =
  B950,  # "line too long", longer than `max-line-length` + 10%

# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
format = wemake

# Let's not overcomplicate the code:
max-complexity = 10

# Accessibility/large fonts and PEP8 friendly.
# This is being flexibly extended through the `flake8-length`:
max-line-length = 79

# Allow certain violations in certain files:
per-file-ignores =

  # WPS412 logic of an extension is in __init__.py file
  # F401   imported but unused
  src/sphinxcontrib/towncrier/__init__.py: F401, WPS412
  # FIXME: WPS201 too many imports
  # FIXME: WPS402 too many `noqa`s
  src/sphinxcontrib/towncrier/ext.py: WPS201, WPS402

  # There are multiple `assert`s (S101)
  # and subprocesses (import – S404; call – S603) in tests;
  # also, using fixtures looks like shadowing the outer scope (WPS442);
  # furthermore, we should be able to import and test private attributes
  # (WPS450) and modules (WPS436) and finally it's impossible to
  # have <= members in tests (WPS202):
  tests/**.py: S101, S404, S603, WPS202, WPS436, WPS442, WPS450

# wemake-python-styleguide
show-source = true

# flake8-pytest-style
# PT001:
pytest-fixture-no-parentheses = true
# PT006:
pytest-parametrize-names-type = tuple
# PT007:
pytest-parametrize-values-type = tuple
pytest-parametrize-values-row-type = tuple

# flake8-rst-docstrings
rst-roles =
    # Built-in Sphinx roles:
    class,
    file,
    py:class,
    py:meth,
    # Sphinx's internal role:
    event,
