Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jl-wynen opened this issue May 29, 2024 · 0 comments
Open

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

jl-wynen opened this issue May 29, 2024 · 0 comments

Comments

@jl-wynen
Copy link
Member

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.

@SimonHeybrock 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant