The name of a method does not follow the configured case style

tx0/python:method-name-stylestrictnotestyle

What it finds

Methods are written in snake_case by PEP 8, like functions. Methods marked @override keep the name of the method they replace and are not checked, and neither are the hooks of unittest, ast.NodeVisitor, docutils visitors and http.server, whose names the base classes choose; the ignore parameter lists them by default.

The style is set by the style parameter: snake_case, PascalCase, camelCase, UPPER_CASE, or any to accept every name. Leading and trailing underscores are not part of the style, and names with letters outside ASCII are not judged. Names that match one of the ignore patterns, where * stands for any text, are left alone. Stubs are not checked, since their names are those of the code they describe.

From the rule's source, method_name_style.rs.

Example from the rule's tests
class Reader:    def readAll(self):tx0 reports: the method readAll is not written in snake_case        pass     def read_all(self):        pass     def setUp(self):        pass     def visit_FunctionDef(self, node):        pass     @override    def getValue(self):        pass  def loadFile(path):    return path
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/python:method-name-style" = "note"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

# tx0: ignore[tx0/python:method-name-style] reason="..."

tx0 explain tx0/python:method-name-style shows the same in the terminal. Found a false positive? Report it.