You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
SimonHeybrock
changed the title
Remove blanked ignore of ruff I rules for __init__.py
Remove blanket ignore of ruff I rules for __init__.py
May 30, 2024
In
pyproject.toml
, we have"__init__.py" = ["I"]
undertool.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.The text was updated successfully, but these errors were encountered: