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
When extending another file, I want to be able to extend the 'banned-api' configuration. The specific use case here is to ban some imports specifically for a subset of my test files (unit tests shouldn't access code intended for integration tests).
The current behaviour is for banned-api to be overwritten completely when set in my file, requiring managing my project level bans in any file that wants to extend the list of banned APIs.
I think that ideally any configurations like [tool.ruff.lint.flake8-tidy-imports.banned-api] should also support the extend = '../pyproject.toml syntax (so users can choose between extending the existing configuration option or replacing it - and avoiding breaking changes here).
Other configuration options that might benefit from similar semantics (that I don't use but just from 👀 settings page in docs):
Note: this would also be solved by #1507 if implemented (which suggests making banned-api a core feature of ruff with a dedicated select / ignore configuration.
The text was updated successfully, but these errors were encountered:
When extending another file, I want to be able to extend the 'banned-api' configuration. The specific use case here is to ban some imports specifically for a subset of my test files (unit tests shouldn't access code intended for integration tests).
The current behaviour is for
banned-api
to be overwritten completely when set in my file, requiring managing my project level bans in any file that wants to extend the list of banned APIs.I think that ideally any configurations like
[tool.ruff.lint.flake8-tidy-imports.banned-api]
should also support theextend = '../pyproject.toml
syntax (so users can choose between extending the existing configuration option or replacing it - and avoiding breaking changes here).Other configuration options that might benefit from similar semantics (that I don't use but just from 👀 settings page in docs):
[tool.ruff.lint.flake8-import-conventions.aliases]
[tool.ruff.lint.flake8-import-conventions.banned-aliases]
tool.ruff.lint.flake8-import-conventions.extend-aliases]
It would also be useful to have similar semantics somehow for list based configurations, but I'm unsure how that could be supported cleanly.
Keywords:
extend
TID251
flake8-tidy-imports
banned-api
Note: this would also be solved by #1507 if implemented (which suggests making banned-api a core feature of ruff with a dedicated select / ignore configuration.
The text was updated successfully, but these errors were encountered: