[flake8]

# Print the total number of errors:
count = true

# Don't even try to analyze these:
extend-exclude =
  # Circle CI configs
  .circleci,
  # 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 cheroot 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 =
  # Legitimate cases, no need to "fix" these violations:
  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
  WPS326,  # "Found implicit string concatenation" -- nothing bad about this

  # FIXME: These stdlib errors need fixing and removal
  E402,  # module level import not at top of file

  # FIXME: These `flake8-logging-format` errors need fixing and removal
  G010,  # Logging statement uses 'warn' instead of 'warning'

  # FIXME: These `flake8-length` errors need fixing and removal
  LN001,  # code line is too long
  LN002,  # doc/comment line is too long

  # FIXME: These `flake8-annotations` errors need fixing and removal
  SC100,  # Possibly misspelt word / comments
  SC200,  # Possibly misspelt word / names

  # FIXME: These `wemake-python-styleguide` errors need fixing and removal
  WPS110,  # Found wrong variable name
  WPS111,  # Found too short name
  WPS204,  # Found overused expression
  WPS210,  # Found too many local variables
  WPS221,  # Found line with high Jones Complexity
  WPS226,  # Found string literal over-use
  WPS336,  # Found explicit string concatenation
  WPS339,  # Found number with meaningless zeros
  WPS347,  # Found vague import that may cause confusion: to_bytes
  WPS360,  # Found an unnecessary use of a raw string
  WPS362,  # Found assignment to a subscript slice
  WPS400,  # Found wrong magic comment  # Needed for mypy typing
  WPS402,  # Found `noqa` comments overuse
  WPS420,  # Found wrong keyword: pass
  WPS422,  # Found future import: absolute_import
  WPS433,  # Found nested import
  WPS436,  # Found protected module import: _text
  WPS453,  # Found executable mismatch: shebang is present but the file is not executable
  WPS463,  # Found a getter without a return value
  WPS504,  # Found negated condition
  WPS528,  # Found implicit `.items()` usage
  WPS531,  # Found simplifiable returning `if` condition in a function
  WPS608,  # Found incorrect `super()` call: remove arguments  # py2 still needs this

# 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:
max-line-length = 79

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

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

# flake8-eradicate
# E800:
eradicate-whitelist-extend = 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
# PT023:
pytest-mark-no-parentheses = true

# flake8-rst-docstrings
rst-directives =
  spelling
rst-roles =
  # Built-in Sphinx roles:
  class,
  data,
  exc,
  meth,
  term,
  py:class,
  py:data,
  py:exc,
  py:meth,
  py:term,
  # Sphinx's internal role:
  event,

# wemake-python-styleguide
show-source = true
