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

[pylint] Add allow-dunder-method-names setting for bad-dunder-method-name (PLW3201) #8812

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

ThiefMaster
Copy link
Contributor

closes #8732

I noticed that the reference to the setting in the rule docs doesn't work, but there seem to be something wrong with pylint settings in general in the docs - the "For related settings, see ...." is also missing there.

Copy link
Contributor

github-actions bot commented Nov 21, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@zanieb
Copy link
Member

zanieb commented Nov 21, 2023

The related settings section is generated on build e.g.

for line in documentation.split_inclusive('\n') {
if line.starts_with("## ") {
in_options = line == "## Options\n";
} else if in_options {
if let Some(rest) = line.strip_prefix("- `") {
let option = rest.trim_end().trim_end_matches('`');
match Options::metadata().find(option) {
Some(OptionEntry::Field(field)) => {
if field.deprecated.is_some() {
eprintln!("Rule {rule_name} references deprecated option {option}.");
}
}
Some(_) => {}
None => {
panic!("Unknown option {option} referenced by rule {rule_name}");
}
}
let anchor = option.replace('.', "-");
out.push_str(&format!("- [`{option}`][{option}]\n"));
after.push_str(&format!("[{option}]: ../settings.md#{anchor}\n"));
continue;
}
}

@ThiefMaster
Copy link
Contributor Author

Huh, I thought I executed that script. anyway, that indeed fixed the problem of the broken linking. Still no idea why the link from the rules page to the settings page isn't generated, but that's unrelated to this PR anyway..

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@charliermarsh charliermarsh added the configuration Related to settings and configuration label Nov 21, 2023
@charliermarsh charliermarsh changed the title Add custom-dunder-method-names setting for PLW3201 [pylint] Add allow-dunder-method-names setting for bad-dunder-method-name (PLW3201) Nov 21, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) November 21, 2023 23:40
@charliermarsh charliermarsh merged commit 948094e into astral-sh:main Nov 21, 2023
16 checks passed
@ThiefMaster ThiefMaster deleted the custom-dunder-names branch November 21, 2023 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(🎁) bad-dunder-method-name config option
3 participants