[flake8]

# Print the total number of errors:
count = true

# Don't even try to analyze these:
extend-exclude =
  # No need to traverse egg info dir
  *.egg-info,
  # GitHub configs
  .github,
  # Cache files of MyPy
  .mypy_cache,
  # Cache files of pytest
  .pytest_cache,
  # Temp dir of pytest-testmon
  .tmontmp,
  # Occasional virtualenv dir
  .venv
  # VS Code
  .vscode,
  # 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,

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

# IMPORTANT: avoid using ignore option, always use extend-ignore instead
# Completely and unconditionally ignore the following errors:
extend-ignore =
  I  # flake8-isort is drunk + we have isort integrated into pre-commit
  WPS300  # "Found local folder import" -- nothing bad about this
  WPS306  # "Found class without a base class: *" -- we have metaclass shims

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

# Accessibility/large fonts and PEP8 friendly:
max-line-length = 79

# Allow certain violations in certain files:
per-file-ignores =
  # There are multiple `assert`s (S101)
  # and subprocesses (import – S404; call – S603) in tests;
  # also, using fixtures looks like shadowing the outer scope (WPS442);
  # and finally it's impossible to have <= members in tests (WPS202):
  tests/**.py: S101, S404, S603, WPS202, WPS442

  # The lexer test compares huge HTML snippets that have legit long lines:
  # E501 line too long
  tests/lexer_test.py: E501

# Count the number of occurrences of each error/warning code and print a report:
statistics = true

# flake8-eradicate
# E800:
eradicate-whitelist-extend = distutils:\s+libraries\s+=\s+|isort:\s+\w+

# 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:
    py:class,
    py:meth,
    # Sphinx's internal role:
    event,

# wemake-python-styleguide
show-source = true
