Add ruff settings to pyproject

This commit is contained in:
Alexander Wainwright
2025-12-27 12:07:17 +10:00
parent c1b031f29e
commit 3d8063d984

View File

@@ -27,3 +27,43 @@ where = ["src"]
[project.scripts]
emulsion = "emulsion.main:main"
[tool.ruff]
line-length = 80
[tool.ruff.lint]
select = [
"B",
"W",
# "ANN",
"FIX",
"S",
"F", # Pyflakes rules
"W", # PyCodeStyle warnings
"E", # PyCodeStyle errors
"I", # Sort imports "properly"
"UP", # Warn if certain things can changed due to newer Python versions
"C4", # Catch incorrect use of comprehensions, dict, list, etc
"FA", # Enforce from __future__ import annotations
"ISC", # Good use of string concatenation
"ICN", # Use common import conventions
"RET", # Good return practices
"SIM", # Common simplification rules
"TID", # Some good import practices
"TC", # Enforce importing certain types in a TYPE_CHECKING block
# "PTH", # Use pathlib instead of os.path
"NPY", # Some numpy-specific things
]
ignore = [
"W191",
"E101", # allow spaces for alignment
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402"]
[tool.ruff.format]
quote-style = "single"
indent-style = "tab"