class documentation

class RecommendationChecker(checkers.BaseChecker): (source)

View In Hierarchy

Undocumented

Method open Called before visiting project (i.e. set of modules).
Method visit_call Undocumented
Method visit_comprehension Undocumented
Method visit_const Undocumented
Method visit_for Undocumented
Class Variable msgs Undocumented
Class Variable name Name of the provider.
Static Method _is_builtin Undocumented
Method _check_consider_iterating_dictionary Undocumented
Method _check_consider_using_dict_items Add message when accessing dict values by index lookup.
Method _check_consider_using_dict_items_comprehension Add message when accessing dict values by index lookup.
Method _check_consider_using_enumerate Emit a convention whenever range and len are used for indexing.
Method _check_use_maxsplit_arg Add message when accessing first or last elements of a str.split() or str.rsplit().
Method _check_use_sequence_for_iteration Check if code iterates over an in-place defined set.
Method _detect_replacable_format_call Check whether a string is used in a call to format() or '%' and whether it can be replaced by an f-string.
Instance Variable _py36_plus 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_message Undocumented
Method check_consistency Check the consistency of msgid.
Method close Called after visiting project (i.e set of modules).
Method create_message_definition_from_tuple Undocumented
Method get_full_documentation Undocumented
Method get_map_data Undocumented
Method get_message_definition Undocumented
Method reduce_map_data Undocumented
Class Variable enabled 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_option_def DEPRECATED: Return the dictionary defining an option given its name.
Method level.setter Undocumented
Method load_defaults DEPRECATED: Initialize the provider using default values.
Method option_attrname DEPRECATED: Get the config attribute corresponding to opt.
Method option_value DEPRECATED: Get the current value for the given option.
Method options_and_values DEPRECATED.
Method options_by_section DEPRECATED: Return an iterator on options grouped by section.
Method set_option DEPRECATED: Method called to set an option (registered in the options list).
Class Variable option_groups_descs Option groups of this provider and their descriptions.
Property config Undocumented
Property level Undocumented
Instance Variable _arguments_manager The manager that will parse and register any options provided.
Instance Variable _level Undocumented
def open(self): (source)

Called before visiting project (i.e. set of modules).

@utils.only_required_for_messages('consider-iterating-dictionary', 'use-maxsplit-arg')
def visit_call(self, node: nodes.Call): (source)

Undocumented

@utils.only_required_for_messages('consider-using-dict-items', 'use-sequence-for-iteration')
def visit_comprehension(self, node: nodes.Comprehension): (source)

Undocumented

@utils.only_required_for_messages('consider-using-f-string')
def visit_const(self, node: nodes.Const): (source)

Undocumented

@utils.only_required_for_messages('consider-using-enumerate', 'consider-using-dict-items', 'use-sequence-for-iteration')
def visit_for(self, node: nodes.For): (source)

Undocumented

Name of the provider.

@staticmethod
def _is_builtin(node: nodes.NodeNG, function: str) -> bool: (source)

Undocumented

def _check_consider_iterating_dictionary(self, node: nodes.Call): (source)

Undocumented

def _check_consider_using_dict_items(self, node: nodes.For): (source)

Add message when accessing dict values by index lookup.

def _check_consider_using_dict_items_comprehension(self, node: nodes.Comprehension): (source)

Add message when accessing dict values by index lookup.

def _check_consider_using_enumerate(self, node: nodes.For): (source)

Emit a convention whenever range and len are used for indexing.

def _check_use_maxsplit_arg(self, node: nodes.Call): (source)

Add message when accessing first or last elements of a str.split() or str.rsplit().

def _check_use_sequence_for_iteration(self, node: nodes.For|nodes.Comprehension): (source)

Check if code iterates over an in-place defined set. Sets using `*` are not considered in-place.

def _detect_replacable_format_call(self, node: nodes.Const): (source)

Check whether a string is used in a call to format() or '%' and whether it can be replaced by an f-string.

_py36_plus = (source)

Undocumented