From 3d8063d98481b1e9149b478499ebc6f0d8540b21 Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Sat, 27 Dec 2025 12:07:17 +1000 Subject: [PATCH] Add ruff settings to pyproject --- pyproject.toml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ed26515..b74308d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"