[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,
  # Countless third-party libs in venvs
  .tox,
  # Occasional virtualenv dir
  .venv,
  # VS Code
  .vscode,
  # Temporary build dir
  build,
  # This contains sdists and wheels 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`
  E501,
  # W505: "doc line too long", its function is replaced by `flake8-length`
  W505,
  # WPS300: "Found local folder import" -- nothing bad about this
  WPS300,
  # WPS422: "Found future import: *" -- we need these for multipython
  WPS422,

filename =
  # Normal Python files (default):
  *.py,
  # Cython files:
  *.pyx

format = wemake

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

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

# Allow certain violations in certain files:
# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future
per-file-ignores =
  # The following ignores have been researched and should be considered permanent
  # each should be preceded with an explanation of each of the error codes
  # If other ignores are added for a specific file in the section following this,
  # these will need to be added to that line as well.

  # ANN001 Missing type annotation for function argument 'legacy_manylinux_tag' — FIXME
  # ANN201 Missing return type annotation for public function — FIXME
  build-scripts/manylinux-container-image/manylinux_mapping.py: ANN001, ANN201

  # in-tree PEP517 build backend needs a lot of legit `noqa`s,
  # members and imports:
  packaging/pep517_backend/_backend.py: WPS201, WPS202, WPS402

  # F401   imported but unused
  packaging/pep517_backend/hooks.py: F401

  # The package has imports exposing private things to the public:
  src/pylibsshext/__init__.py: WPS412

  # Exclude errors that don't make sense for Cython
  # Examples:
  # * "E211 whitespace before '('" happening to "typedef int (*smth) ..."
  # * "E226 missing whitespace around arithmetic operator"
  src/pylibsshext/*.pxd: E211, E225, E226, E227, E999
  src/pylibsshext/*.pyx: E225, E226, E227, E999

  # There are multiple `assert`s (S101)
  # and subprocesses (import – S404; call – S603) in tests;
  # and finally it's impossible to
  # have <= members in tests (WPS202), including many local vars (WPS210):
  # ANN001 Missing type annotation for function argument 'legacy_manylinux_tag' — FIXME
  # ANN201 Missing return type annotation for public function — FIXME
  # ANN202 Missing return type annotation for protected function — FIXME
  tests/**.py: ANN001, ANN201, ANN202, S101, S404, S603, WPS202, WPS210


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

# ## Plugin-provided settings: ##

# 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

# wemake-python-styleguide
show-source = true
show-violation-links = true
