class documentation
class StringFormatChecker(BaseChecker): (source)
Checks string formatting operations to ensure that the format string is valid and the arguments match the format string.
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Class Variable | name |
Name of the provider. |
Method | _check |
Undocumented |
Method | _check |
Check the new string formatting. |
Method | _check |
Check attribute and index access in the format string ("{0.a}" and "{0[a]}"). |
Method | _detect |
Undocumented |
Inherited from BaseChecker
:
Method | __eq__ |
Permit to assert Checkers are equal. |
Method | __gt__ |
Sorting of checkers. |
Method | __hash__ |
Make Checker hashable. |
Method | __init__ |
Checker instances should have the linter as argument. |
Method | __repr__ |
Undocumented |
Method | __str__ |
This might be incomplete because multiple classes inheriting BaseChecker can have the same name. |
Method | add |
Undocumented |
Method | check |
Check the consistency of msgid. |
Method | close |
Called after visiting project (i.e set of modules). |
Method | create |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | open |
Called before visiting project (i.e. set of modules). |
Method | reduce |
Undocumented |
Class Variable | enabled |
Undocumented |
Class Variable | msgs |
Undocumented |
Class Variable | options |
Options provided by this provider. |
Class Variable | reports |
Undocumented |
Instance Variable | linter |
Undocumented |
Property | messages |
Undocumented |
Inherited from _ArgumentsProvider
(via BaseChecker
):
Method | get |
DEPRECATED: Return the dictionary defining an option given its name. |
Method | level |
Undocumented |
Method | load |
DEPRECATED: Initialize the provider using default values. |
Method | option |
DEPRECATED: Get the config attribute corresponding to opt. |
Method | option |
DEPRECATED: Get the current value for the given option. |
Method | options |
DEPRECATED. |
Method | options |
DEPRECATED: Return an iterator on options grouped by section. |
Method | set |
DEPRECATED: Method called to set an option (registered in the options list). |
Class Variable | option |
Option groups of this provider and their descriptions. |
Property | config |
Undocumented |
Property | level |
Undocumented |
Instance Variable | _arguments |
The manager that will parse and register any options provided. |
Instance Variable | _level |
Undocumented |
@only_required_for_messages( 'bad-format-character', 'truncated-format-string', 'mixed-format-string', 'bad-format-string-key', 'missing-format-string-key', 'unused-format-string-key', 'bad-string-format-type', 'format-needs-mapping', 'too-many-format-args', 'too-few-format-args', 'format-string-without-interpolation')
def visit_binop(self, node:
def visit_binop(self, node:
nodes.BinOp
):
(source)
¶
Undocumented
@only_required_for_messages( 'f-string-without-interpolation')
def visit_joinedstr(self, node:
def visit_joinedstr(self, node:
nodes.JoinedStr
):
(source)
¶
Undocumented
def _check_new_format_specifiers(self, node:
nodes.Call
, fields: list[ tuple[ str, list[ tuple[ bool, str]]]]
, named: dict[ str, SuccessfulInferenceResult]
):
(source)
¶
Check attribute and index access in the format string ("{0.a}" and "{0[a]}").
def _detect_vacuous_formatting(self, node:
nodes.Call
, positional_arguments: list[ SuccessfulInferenceResult]
):
(source)
¶
Undocumented