Skip to content

Commit

Permalink
Rename Ruff sections and remove flake8.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnmabus committed Jan 22, 2024
1 parent 1fae35a commit 1bcbd1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 126 deletions.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ include = ["rdata*"]
[tool.setuptools.dynamic]
version = {attr = "rdata.__version__"}

[tool.ruff]
[tool.ruff.lint]
select = [
"ALL",
]
Expand All @@ -88,7 +88,7 @@ ignore = [
"TID252", # relative imports allowed
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"plot_*.py" = [
"ANN", # no type hints in examples
"ARG001", # Some unused args are needed
Expand All @@ -103,11 +103,11 @@ ignore = [
"SIM117", # multiple with necessary for now
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.pylint]
[tool.ruff.lint.pylint]
max-args = 7
121 changes: 0 additions & 121 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,127 +13,6 @@ use_parentheses = true
combine_as_imports = 1
skip_glob = **/plot_*.py plot_*.py

[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
Expand Down

0 comments on commit 1bcbd1b

Please sign in to comment.