class documentation

class ExceptionsChecker(checkers.BaseChecker): (source)

View In Hierarchy

Exception related checks.

Method open Called before visiting project (i.e. set of modules).
Method visit_binop Undocumented
Method visit_compare Undocumented
Method visit_raise Undocumented
Method visit_tryexcept Check for empty except.
Class Variable name Name of the provider.
Class Variable options Options provided by this provider.
Method _check_bad_exception_cause Verify that the exception cause is properly set.
Method _check_catching_non_exception Undocumented
Method _check_misplaced_bare_raise Undocumented
Method _check_raise_missing_from Undocumented
Method _check_try_except_raise Undocumented
Method _is_overgeneral_exception Undocumented
Instance Variable _builtin_exceptions 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 msgs Undocumented
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('wrong-exception-operation')
def visit_binop(self, node: nodes.BinOp): (source)

Undocumented

@utils.only_required_for_messages('wrong-exception-operation')
def visit_compare(self, node: nodes.Compare): (source)

Undocumented

@utils.only_required_for_messages('misplaced-bare-raise', 'raising-bad-type', 'raising-non-exception', 'notimplemented-raised', 'bad-exception-cause', 'raising-format-tuple', 'raise-missing-from', 'broad-exception-raised')
def visit_raise(self, node: nodes.Raise): (source)

Undocumented

@utils.only_required_for_messages('bare-except', 'broad-exception-caught', 'try-except-raise', 'binary-op-exception', 'bad-except-order', 'catching-non-exception', 'duplicate-except')
def visit_tryexcept(self, node: nodes.TryExcept): (source)

Check for empty except.

Name of the provider.

options: tuple[tuple, ...] = (source)

Options provided by this provider.

def _check_bad_exception_cause(self, node: nodes.Raise): (source)

Verify that the exception cause is properly set. An exception cause can be only `None` or an exception.

def _check_catching_non_exception(self, handler: nodes.ExceptHandler, exc: SuccessfulInferenceResult, part: nodes.NodeNG): (source)

Undocumented

def _check_misplaced_bare_raise(self, node: nodes.Raise): (source)

Undocumented

def _check_raise_missing_from(self, node: nodes.Raise): (source)

Undocumented

def _check_try_except_raise(self, node: nodes.TryExcept): (source)

Undocumented

def _is_overgeneral_exception(self, exception: nodes.ClassDef) -> bool: (source)

Undocumented

_builtin_exceptions = (source)

Undocumented