-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[flake8-builtins
] Update documentation (A005
)
#16097
base: main
Are you sure you want to change the base?
Conversation
Follow-up to #15951 to update * the options links in A005 to reference `lint.flake8-builtins.builtins-strict-checking` * the description of the rule to explain strict vs non-strict checking * the option documentation to point back to the rule
|
/// `a/logging.py`, `a/b/logging.py`, and so on would all clash with the builtin `logging` module. | ||
/// With the [`lint.flake8-builtins.builtins-strict-checking`] option set to `false`, the module | ||
/// path is considered, so only a top-level `logging.py` or `logging/__init__.py` will trigger the | ||
/// rule and `utils/logging.py`, for example, would not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps re-use example from above a/logging.py
(or use the utils/logging.py
example above)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good idea, thanks! I went for a consistent use of the logging
example:
ruff/crates/ruff_linter/src/rules/flake8_builtins/rules/stdlib_module_shadowing.rs
Lines 26 to 30 in 6e64c4c
/// By default, only the last component of the module name is considered, so `logging.py`, | |
/// `utils/logging.py`, and `utils/logging/__init__.py` would all clash with the builtin `logging` | |
/// module. With the [`lint.flake8-builtins.builtins-strict-checking`] option set to `false`, the | |
/// module path is considered, so only a top-level `logging.py` or `logging/__init__.py` will | |
/// trigger the rule and `utils/logging.py`, for example, would not. |
What do you think?
/// By default, only the last component of the module name is considered, so `logging.py`, | ||
/// `utils/logging.py`, and `utils/logging/__init__.py` would all clash with the builtin `logging` | ||
/// module. With the [`lint.flake8-builtins.builtins-strict-checking`] option set to `false`, the | ||
/// module path is considered, so only a top-level `logging.py` or `logging/__init__.py` will | ||
/// trigger the rule and `utils/logging.py`, for example, would not. | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document here or on the option the difference between preview and non preview. The way I remember it is that the default changes based on preview mode.
Follow-up to #15951 to update
lint.flake8-builtins.builtins-strict-checking