[aliases]
test=pytest
[tool:pytest]
addopts = --doctest-modules --doctest-glob="*.rst"
doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
[isort]
multi_line_output = 3
include_trailing_comma = true
use_parentheses = true
combine_as_imports = 1
[flake8]
ignore =
# No docstring for magic methods
D105,
# No docstrings in __init__
D107,
# Ignore until https://github.com/terrencepreilly/darglint/issues/54 is closed
DAR202,
# Ignore until https://github.com/terrencepreilly/darglint/issues/144 is closed
DAR401,
# Non-explicit exceptions may be documented in raises
DAR402,
# Uppercase arguments like X are common in scikit-learn
N803,
# Uppercase variables like X are common in scikit-learn
N806,
# There are no bad quotes
Q000,
# Google Python style is not RST until after processed by Napoleon
# See https://github.com/peterjc/flake8-rst-docstrings/issues/17
RST201, RST203, RST301,
# assert is used by pytest tests
S101,
# Line break occurred before a binary operator (antipattern)
W503,
# Utils is used as a module name
WPS100,
# Short names like X or y are common in scikit-learn
WPS111,
# We do not like this underscored numbers convention
WPS114,
# Attributes in uppercase are used in enums
WPS115,
# Trailing underscores are a scikit-learn convention
WPS120,
# Cognitive complexity cannot be avoided at some modules
WPS232,
# The number of imported things may be large, especially for typing
WPS235,
# We like local imports, thanks
WPS300,
# Dotted imports are ok
WPS301,
# We love f-strings
WPS305,
# Implicit string concatenation is useful for exception messages
WPS306,
# No base class needed
WPS326,
# We allow multiline conditions
WPS337,
# We order methods differently
WPS338,
# We need multine loops
WPS352,
# Assign to a subcript slice is normal behaviour in numpy
WPS362,
# All keywords are beautiful
WPS420,
# We use nested imports sometimes, and it is not THAT bad
WPS433,
# We use list multiplication to allocate list with immutable values (None or numbers)
WPS435,
# Our private modules are fine to import
# (check https://github.com/wemake-services/wemake-python-styleguide/issues/1441)
WPS436,
# Our private objects are fine to import
WPS450,
# Numpy mixes bitwise and comparison operators
WPS465,
# Explicit len compare is better than implicit
WPS507,
# Comparison with not is not the same as with equality
WPS520,
per-file-ignores =
__init__.py:
# Unused modules are allowed in `__init__.py`, to reduce imports
F401,
# Explicit re-exports allowed in __init__
WPS113,
# Import multiple names is allowed in `__init__.py`
WPS235,
# Logic is allowed in `__init__.py`
WPS412
# Tests benefit from overused expressions, magic numbers and fixtures
test_*.py: WPS204, WPS432, WPS442
rst-directives =
# These are sorted alphabetically - but that does not matter
autosummary,data,currentmodule,deprecated,
glossary,moduleauthor,plot,testcode,
versionadded,versionchanged,
rst-roles =
attr,class,func,meth,mod,obj,ref,term,
allowed-domain-names = data, info, obj, result, results, val, value, values, var
# Needs to be tuned
max-arguments = 10
max-attributes = 10
max-cognitive-score = 30
max-expressions = 15
max-imports = 20
max-line-complexity = 30
max-local-variables = 15
max-methods = 30
max-module-expressions = 15
max-module-members = 15
max-string-usages = 10
ignore-decorators = (property)|(overload)
strictness = long
# Beautify output and make it more informative
format = wemake
show-source = true
[mypy]
strict = True
strict_equality = True
implicit_reexport = True
[mypy-numpy.*]
ignore_missing_imports = True
[mypy-pandas.*]
ignore_missing_imports = True
[mypy-setuptools.*]
ignore_missing_imports = True