From 62cdf874e6408ba0e96516c965bb416cdcdc1e83 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 12 May 2026 11:25:58 +0200 Subject: [PATCH] enforce FBT001/FBT002 and N802 ruff rules --- microgen/shape/strut_lattice/abstract_lattice.py | 1 + microgen/shape/strut_lattice/custom_lattice.py | 3 ++- pyproject.toml | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/microgen/shape/strut_lattice/abstract_lattice.py b/microgen/shape/strut_lattice/abstract_lattice.py index d0a57658..4453eea0 100644 --- a/microgen/shape/strut_lattice/abstract_lattice.py +++ b/microgen/shape/strut_lattice/abstract_lattice.py @@ -46,6 +46,7 @@ def __init__( strut_heights: float | list[float] | None = None, base_vertices: npt.NDArray[np.float64] | None = None, strut_vertex_pairs: npt.NDArray[np.int64] | None = None, + *, cell_size: float = 1.0, strut_joints: bool = False, density: float | None = None, diff --git a/microgen/shape/strut_lattice/custom_lattice.py b/microgen/shape/strut_lattice/custom_lattice.py index c4f3b666..fb52b16a 100644 --- a/microgen/shape/strut_lattice/custom_lattice.py +++ b/microgen/shape/strut_lattice/custom_lattice.py @@ -21,10 +21,11 @@ class CustomLattice(AbstractLattice): Uses user-defined base vertices and strut vertex pairs. """ - def __init__( # noqa: PLR0913 + def __init__( self, base_vertices: npt.NDArray[np.float64], strut_vertex_pairs: npt.NDArray[np.int64], + *, strut_radius: float | None = None, strut_heights: float | list[float] | None = None, cell_size: float = 1.0, diff --git a/pyproject.toml b/pyproject.toml index 8cf4b097..7a1841ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,6 +85,13 @@ ignore_missing_imports = true target-version = "py310" [tool.ruff.lint] +extend-select = [ + # Boolean traps — booleans in public APIs must be keyword-only. + "FBT001", + "FBT002", + # Function names must be lowercase. + "N802", +] exclude = [ "docs/*", "tests/*",