class Errors: (source)
Container for compile errors.
This class generates and keeps tracks of compile errors and the current error context (nested imports).
Method | __init__ |
Undocumented |
Method | add_error_info |
Undocumented |
Method | blocker_module |
Return the module with a blocking error, or None if not possible. |
Method | clear_errors_in_targets |
Remove errors in specific fine-grained targets within a file. |
Method | copy |
Undocumented |
Method | current_module |
Undocumented |
Method | current_target |
Retrieves the current target from the associated scope. |
Method | file_messages |
Return a string list of new error messages from a given file. |
Method | format_messages |
Return a string list that represents the error messages. |
Method | generate_unused_ignore_errors |
Undocumented |
Method | has_many_errors |
Undocumented |
Method | import_context |
Return a copy of the import context. |
Method | initialize |
Undocumented |
Method | is_blockers |
Are the any errors that are blockers? |
Method | is_error_code_enabled |
Undocumented |
Method | is_errors |
Are there any generated messages? |
Method | is_errors_for_file |
Are there any errors for the given file? |
Method | is_ignored_error |
Undocumented |
Method | is_real_errors |
Are there any generated errors (not just notes, for example)? |
Method | most_recent_error_location |
Undocumented |
Method | new_messages |
Return a string list of new error messages. |
Method | num_messages |
Return the number of generated messages. |
Method | raise_error |
Raise a CompileError with the generated messages. |
Method | remove_duplicates |
Remove duplicates from a sorted error list. |
Method | render_messages |
Translate the messages into a sequence of tuples. |
Method | report |
Report message at the given line using the current error context. |
Method | report_hidden_errors |
Undocumented |
Method | reset |
Undocumented |
Method | set_file |
Set the path and module id of the current file. |
Method | set_file_ignored_lines |
Undocumented |
Method | set_ignore_prefix |
Set path prefix that will be removed from all paths. |
Method | set_import_context |
Replace the entire import context with a new value. |
Method | simplify_path |
Undocumented |
Method | sort_messages |
Sort an array of error messages locally by line number. |
Method | targets |
Return a set of all targets that contain errors. |
Method | total_errors |
Undocumented |
Instance Variable | disabled_error_codes |
Undocumented |
Instance Variable | enabled_error_codes |
Undocumented |
Instance Variable | error_info_map |
Undocumented |
Instance Variable | file |
Undocumented |
Instance Variable | flushed_files |
Undocumented |
Instance Variable | function_or_member |
Undocumented |
Instance Variable | ignore_prefix |
Undocumented |
Instance Variable | ignored_files |
Undocumented |
Instance Variable | ignored_lines |
Undocumented |
Instance Variable | import_ctx |
Undocumented |
Instance Variable | many_errors_threshold |
Undocumented |
Instance Variable | only_once_messages |
Undocumented |
Instance Variable | pretty |
Undocumented |
Instance Variable | read_source |
Undocumented |
Instance Variable | scope |
Undocumented |
Instance Variable | seen_import_error |
Undocumented |
Instance Variable | show_absolute_path |
Undocumented |
Instance Variable | show_column_numbers |
Undocumented |
Instance Variable | show_error_codes |
Undocumented |
Instance Variable | show_error_context |
Undocumented |
Instance Variable | target_module |
Undocumented |
Instance Variable | used_ignored_lines |
Undocumented |
Method | _add_error_info |
Undocumented |
Undocumented
Parameters | |
show_error_context:bool | Undocumented |
show_column_numbers:bool | Undocumented |
show_error_codes:bool | Undocumented |
pretty:bool | Undocumented |
read_source:Optional[ | Undocumented |
show_absolute_path:bool | Undocumented |
enabled_error_codes:Optional[ | Undocumented |
disabled_error_codes:Optional[ | Undocumented |
many_errors_threshold:int | Undocumented |
Parameters | |
path:str | Undocumented |
targets:Set[ | Undocumented |
Retrieves the current target from the associated scope.
If there is no associated scope, use the target module.
Returns | |
Optional[ | Undocumented |
Return a string list of new error messages from a given file.
Use a form suitable for displaying to the user.
Parameters | |
path:str | Undocumented |
Returns | |
List[ | Undocumented |
Return a string list that represents the error messages.
Use a form suitable for displaying to the user. If self.pretty is True also append a relevant trimmed source code line (only for severity 'error').
Parameters | |
error_info:List[ | Undocumented |
source_lines:Optional[ | Undocumented |
Returns | |
List[ | Undocumented |
Undocumented
Parameters | |
line:int | Undocumented |
info:ErrorInfo | Undocumented |
ignores:Dict[ | Undocumented |
Returns | |
bool | Undocumented |
Return a string list of new error messages.
Use a form suitable for displaying to the user. Errors from different files are ordered based on the order in which they first generated an error.
Returns | |
List[ | Undocumented |
Raise a CompileError with the generated messages.
Render the messages suitable for displaying.
Parameters | |
use_stdout:bool | Undocumented |
Parameters | |
errors:List[ | Undocumented |
Returns | |
List[ | Undocumented |
Translate the messages into a sequence of tuples.
Each tuple is of form (path, line, col, severity, message, allow_dups, code). The rendered sequence includes information about error contexts. The path item may be None. If the line item is negative, the line number is not defined for the tuple.
Parameters | |
errors:List[ | Undocumented |
Returns | |
List[ | Undocumented |
Report message at the given line using the current error context.
Parameters | |
line:int | Undocumented |
column:Optional[ | Undocumented |
message:str | Undocumented |
code:Optional[ | Undocumented |
blocker:bool | Undocumented |
severity:str | Undocumented |
file:Optional[ | Undocumented |
only_once:bool | Undocumented |
allow_dups:bool | Undocumented |
origin_line:Optional[ | Undocumented |
offset:int | Undocumented |
end_line:Optional[ | Undocumented |
Parameters | |
file:str | Undocumented |
module:Optional[ | Undocumented |
scope:Optional[ | Undocumented |
Undocumented
Parameters | |
file:str | Undocumented |
ignored_lines:Dict[ | Undocumented |
ignore_all:bool | Undocumented |