scipp / copier_template

Copier template for Scipp projects
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Remove blanket ignore of ruff I rules for __init__.py #185

Open jl-wynen opened 1 month ago

jl-wynen commented 1 month ago

In pyproject.toml, we have "__init__.py" = ["I"] under tool.ruff.lint.per-file-ignores because package init files sometimes rely on import order. But this also catches subpackages that are implemented in their __init__.py file. In those cases, we do want to sort imports. So I suggest removing the blanked ignore and instead ignore specific files that we know rely on import order.

Alternatively, and maybe cleaner, we would not allow implementing packages in __init__.py and restrict those files to gathering symbols from other modules. But I don't think there is a lint for that. So it is hard to enforce.