Derived from the Pylint linter.
This rule is unstable and in preview. The
--preview flag is required for use.
What it does#
Checks for classes with too many public methods
By default, this rule allows up to 20 public methods, as configured by
Why is this bad?#
Classes with many public methods are harder to understand and maintain.
Instead, consider refactoring the class into separate classes.
pylint.max-public-settings is set to 5:
class Linter: def __init__(self): self.pylint = Pylint() self.flake8 = Flake8() self.pydocstyle = Pydocstyle() def lint(self): pass class Pylint: def lint(self): pass def settings(self): pass class Flake8: def lint(self): pass def settings(self): pass class Pydocstyle: def lint(self): pass def settings(self): pass