Update Ruff settings in project config
This commit is contained in:
+37
-19
@@ -66,23 +66,26 @@ preview = true
|
|||||||
|
|
||||||
# Rules: https://docs.astral.sh/ruff/rules
|
# Rules: https://docs.astral.sh/ruff/rules
|
||||||
select = [
|
select = [
|
||||||
"A", # flake8-builtins (A)
|
"A", # flake8-builtins (A)
|
||||||
"ANN", # flake8-annotations (ANN)
|
"ANN", # flake8-annotations (ANN)
|
||||||
"B", # flake8-bugbear (B)
|
"B", # flake8-bugbear (B)
|
||||||
"E", # pycodestyle (E)
|
"D", # pydocstyle (D)
|
||||||
"F", # Pyflakes (F)
|
"E", # pycodestyle (E)
|
||||||
"FA", # flake8-future-annotations (FA)
|
"F", # Pyflakes (F)
|
||||||
"PERF", # Perflint (PERF)
|
"FA", # flake8-future-annotations (FA)
|
||||||
"PLC", # Pylint Convention (PLC)
|
"PERF", # Perflint (PERF)
|
||||||
"PLE", # Pylint Error (PLE)
|
"PLC", # Pylint Convention (PLC)
|
||||||
"PLW", # Pylint Warning (PLW)
|
"PLE", # Pylint Error (PLE)
|
||||||
"Q", # flake8-quotes (Q)
|
"PLW", # Pylint Warning (PLW)
|
||||||
"RUF", # Ruff-specific rules (RUF)
|
"Q", # flake8-quotes (Q)
|
||||||
"SLF", # flake8-self (SLF)
|
"RUF", # Ruff-specific rules (RUF)
|
||||||
"SLOT", # flake8-slots (SLOT)
|
"SLF", # flake8-self (SLF)
|
||||||
"TC", # flake8-type-checking (TC)
|
"SLOT", # flake8-slots (SLOT)
|
||||||
"UP", # pyupgrade (UP)
|
"TC", # flake8-type-checking (TC)
|
||||||
"W", # pycodestyle (W)
|
"UP", # pyupgrade (UP)
|
||||||
|
"W", # pycodestyle (W)
|
||||||
|
"RET", # flake8-return (RET)
|
||||||
|
"PLR17", # Refactor (PLR) - Only PLR17xx
|
||||||
]
|
]
|
||||||
ignore = [
|
ignore = [
|
||||||
"ANN401", # any-type
|
"ANN401", # any-type
|
||||||
@@ -100,12 +103,28 @@ ignore = [
|
|||||||
"RUF015", # unnecessary-iterable-allocation-for-first-element
|
"RUF015", # unnecessary-iterable-allocation-for-first-element
|
||||||
"UP015", # redundant-open-modes
|
"UP015", # redundant-open-modes
|
||||||
"UP030", # format-literals
|
"UP030", # format-literals
|
||||||
|
"D107", # undocumented-public-init
|
||||||
|
"D205", # missing-blank-line-after-summary
|
||||||
|
"D105", # undocumented-magic-method
|
||||||
|
"RET505", # superfluous-else-return
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
"tests/*" = ["ANN", "SLF", "TC", "PLC2701"]
|
"tests/*" = ["ANN", "SLF", "TC", "PLC2701", "D101", "D102"]
|
||||||
"utils/*" = ["ANN", "SLF", "TC"]
|
"utils/*" = ["ANN", "SLF", "TC"]
|
||||||
|
|
||||||
|
[tool.ruff.lint.pydocstyle]
|
||||||
|
ignore-decorators = [
|
||||||
|
"abc.abstractmethod",
|
||||||
|
"property",
|
||||||
|
"PyQt6.QtCore.pyqtProperty",
|
||||||
|
"typing.overload",
|
||||||
|
"pytest.fixture",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.ruff.lint.pylint]
|
||||||
|
max-nested-blocks = 10
|
||||||
|
|
||||||
[tool.ruff.format]
|
[tool.ruff.format]
|
||||||
quote-style = "double"
|
quote-style = "double"
|
||||||
|
|
||||||
@@ -114,7 +133,6 @@ include = ["novelwriter"]
|
|||||||
exclude = ["**/__pycache__"]
|
exclude = ["**/__pycache__"]
|
||||||
|
|
||||||
reportIncompatibleMethodOverride = false
|
reportIncompatibleMethodOverride = false
|
||||||
|
|
||||||
pythonVersion = "3.10"
|
pythonVersion = "3.10"
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
|
|||||||
Reference in New Issue
Block a user