-
Notifications
You must be signed in to change notification settings - Fork 896
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
Ruff runs all pydocstyle rules when the convention is specified in the config toml files #3684
Comments
For vscode, you should check you are not using fix all in your configuration. |
I am getting errors for rules D213 and D407, which are not included in the google convention per http://www.pydocstyle.org/en/stable/error_codes.html#default-conventions Furthermore I am using |
This seems like a bug. |
Lemme look into it. |
@MichaReiser - In case the bug here is obvious to you, it looks like this diff prevents us from accidentally enabling the diff --git a/crates/ruff/src/settings/mod.rs b/crates/ruff/src/settings/mod.rs
index 1fb944959..df3d11765 100644
--- a/crates/ruff/src/settings/mod.rs
+++ b/crates/ruff/src/settings/mod.rs
@@ -386,7 +386,9 @@ impl From<&Configuration> for RuleTable {
.and_then(|pydocstyle| pydocstyle.convention)
{
for rule in convention.rules_to_be_ignored() {
- rules.disable(*rule);
+ if rules.enabled(*rule) {
+ rules.disable(*rule);
+ }
}
} |
(In other words, calling |
This is definitely a bug since setting
|
Yeah I've confirmed that it's a regression. I'll ship a fix today. |
This behaviour is new in 0.0.258
When running ruff with the
--select
option in a folder with apyproject.toml
orruff.toml
which specifies the pydocstyle convention,ruff always runs all the pydocstyle rules.
Example:
# I want to check for unsorted imports ruff check ruff_doc.py --select=I
ruff_doc.py
pyproject.toml
The result is
I do not expect any output, as I didn't select
D
in my command, and these error codes should be turned off in the google convention.This behaviour is particularly bad in e.g. VSCode with the organize imports functionality, as it also tries to fix all docstring issues in all the conventions, which results in more errors.
The text was updated successfully, but these errors were encountered: