mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 08:30:16 +00:00
[pylint] Implement too-many-public-methods
rule (PLR0904) (#6179)
Implement https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/too-many-public-methods.html Confusingly the rule page mentions a max of 7 while in practice it is 20. https://github.com/search?q=repo%3Apylint-dev%2Fpylint+max-public-methods&type=code ## Summary Implement pylint's R0904 ## Test Plan Unit tests.
This commit is contained in:
parent
36fa1fe359
commit
04183b0299
12 changed files with 283 additions and 2 deletions
|
@ -184,7 +184,7 @@ pub(crate) fn function_visibility(function: &ast::StmtFunctionDef) -> Visibility
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn method_visibility(function: &ast::StmtFunctionDef) -> Visibility {
|
||||
pub fn method_visibility(function: &ast::StmtFunctionDef) -> Visibility {
|
||||
// Is this a setter or deleter?
|
||||
if function.decorator_list.iter().any(|decorator| {
|
||||
collect_call_path(&decorator.expression).is_some_and(|call_path| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue