| Class | DecodeError |
Exception raised when a file cannot be decoded due to an unknown encoding type. |
| Class | FancyFormatter |
Apply color and bold font to terminal output. |
| Class | IdMapper |
Generate integer ids for objects. |
| Function | check_python_version |
Report issues with the Python used to run mypy, dmypy, or stubgen |
| Function | correct_relative_import |
Undocumented |
| Function | count_stats |
Count total number of errors and files in error list. |
| Function | decode_python_encoding |
Read the Python file with while obeying PEP-263 encoding detection. |
| Function | find_python_encoding |
PEP-263 for detecting Python file encoding |
| Function | get_class_descriptors |
Undocumented |
| Function | get_mypy_comments |
Undocumented |
| Function | get_prefix |
Drop the final component of a qualified name (e.g. ('x.y' -> 'x'). |
| Function | get_terminal_width |
Get current terminal width if possible, otherwise return the default one. |
| Function | get_top_two_prefixes |
Return one and two component prefixes of a fully qualified name. |
| Function | get_unique_redefinition_name |
Get a simple redefinition name not present among existing. |
| Function | hard_exit |
Kill the current process without fully cleaning up. |
| Function | hash_digest |
Compute a hash digest of some data. |
| Function | is_stub_package_file |
Undocumented |
| Function | is_sub_path |
Given two paths, return if path1 is a sub-path of path2. |
| Function | is_typeshed_file |
Undocumented |
| Function | module_prefix |
Undocumented |
| Function | parse_gray_color |
Reproduce a gray color in ANSI escape sequence |
| Function | read_py_file |
Try reading a Python file as list of source lines. |
| Function | replace_object_state |
Copy state of old node to the new node. |
| Function | short_type |
Return the last component of the type name of an object. |
| Function | soft_wrap |
Wrap a long error message into few lines. |
| Function | split_module_names |
Return the module and all parent module names. |
| Function | split_target |
Undocumented |
| Function | split_words |
Split line of text into words (but not within quoted groups). |
| Function | trim_source_line |
Trim a line of source code to fit into max_len. |
| Function | try_find_python2_interpreter |
Undocumented |
| Function | unmangle |
Remove internal suffixes from a short name. |
| Function | unnamed_function |
Undocumented |
| Function | write_junit_xml |
Undocumented |
| Constant | CURSES_ENABLED |
Undocumented |
| Constant | DEFAULT_COLUMNS |
Undocumented |
| Constant | default_python2_interpreter |
Undocumented |
| Constant | DEFAULT_SOURCE_OFFSET |
Undocumented |
| Constant | ENCODING_RE |
Undocumented |
| Constant | ERROR_TEMPLATE |
Undocumented |
| Constant | FAIL_TEMPLATE |
Undocumented |
| Constant | fields_cache |
Undocumented |
| Constant | MINIMUM_WIDTH |
Undocumented |
| Constant | MINIMUM_WINDOWS_BUILD_VT100 |
Undocumented |
| Constant | MINIMUM_WINDOWS_MAJOR_VT100 |
Undocumented |
| Constant | PASS_TEMPLATE |
Undocumented |
| Constant | T |
Undocumented |
| Variable | _python2_interpreter |
Undocumented |
Undocumented
| Parameters | |
cur_mod_id:str | Undocumented |
relative:int | Undocumented |
target:str | Undocumented |
is_cur_package_init_file:bool | Undocumented |
| Returns | |
Tuple[ | Undocumented |
| Parameters | |
errors:List[ | Undocumented |
| Returns | |
Tuple[ | Undocumented |
Read the Python file with while obeying PEP-263 encoding detection.
Returns the source as a string.
| Parameters | |
source:bytes | Undocumented |
pyversion:Tuple[ | Undocumented |
| Returns | |
str | Undocumented |
| Parameters | |
text:bytes | Undocumented |
pyversion:Tuple[ | Undocumented |
| Returns | |
Tuple[ | Undocumented |
| Parameters | |
fullname:str | Undocumented |
| Returns | |
str | Undocumented |
Return one and two component prefixes of a fully qualified name.
Given 'a.b.c.d', return ('a', 'a.b').
If fullname has only one component, return (fullname, fullname).
| Parameters | |
fullname:str | Undocumented |
| Returns | |
Tuple[ | Undocumented |
Get a simple redefinition name not present among existing.
For example, for name 'foo' we try 'foo-redefinition', 'foo-redefinition2', 'foo-redefinition3', etc. until we find one that is not in existing.
| Parameters | |
name:str | Undocumented |
existing:Container[ | Undocumented |
| Returns | |
str | Undocumented |
Kill the current process without fully cleaning up.
This can be quite a bit faster than a normal exit() since objects are not freed.
| Parameters | |
status:int | Undocumented |
Compute a hash digest of some data.
We use a cryptographic hash because we want a low probability of accidental collision, but we don't really care about any of the cryptographic properties.
| Parameters | |
data:bytes | Undocumented |
| Returns | |
str | Undocumented |
| Parameters | |
path1:str | Undocumented |
path2:str | Undocumented |
| Returns | |
bool | Undocumented |
Undocumented
| Parameters | |
modules:Iterable[ | Undocumented |
target:str | Undocumented |
| Returns | |
Optional[ | Undocumented |
Try reading a Python file as list of source lines.
Return None if something goes wrong.
| Parameters | |
path:str | Undocumented |
read:Callable[ | Undocumented |
pyversion:Tuple[ | Undocumented |
| Returns | |
Optional[ | Undocumented |
Copy state of old node to the new node.
This handles cases where there is __dict__ and/or attribute descriptors (either from slots or because the type is defined in a C extension module).
Assume that both objects have the same __class__.
| Parameters | |
new:object | Undocumented |
old:object | Undocumented |
copy_dict:bool | Undocumented |
Return the last component of the type name of an object.
If obj is None, return 'nil'. For example, if obj is 1, return 'int'.
| Parameters | |
obj:object | Undocumented |
| Returns | |
str | Undocumented |
Wrap a long error message into few lines.
Breaks will only happen between words, and never inside a quoted group (to avoid breaking types such as "Union[int, str]"). The 'first_offset' is the width before the start of first line.
Pad every next line with 'num_indent' spaces. Every line will be at most 'max_len' characters, except if it is a single word or quoted group.
first_offset
^^^^-------------------------------------------------- num_indent max_len
| Parameters | |
msg:str | Undocumented |
max_len:int | Undocumented |
first_offset:int | Undocumented |
num_indent:int | Undocumented |
| Returns | |
str | Undocumented |
Return the module and all parent module names.
So, if mod_name is 'a.b.c', this function will return
['a.b.c', 'a.b', and 'a'].
| Parameters | |
mod_name:str | Undocumented |
| Returns | |
List[ | Undocumented |
Undocumented
| Parameters | |
modules:Iterable[ | Undocumented |
target:str | Undocumented |
| Returns | |
Optional[ | Undocumented |
| Parameters | |
msg:str | Undocumented |
| Returns | |
List[ | Undocumented |
Trim a line of source code to fit into max_len.
Show 'min_width' characters on each side of 'col' (an error location). If either start or end is trimmed, this is indicated by adding '...' there. A typical result looks like this:
...some_variable = function_to_call(one_arg, other_arg) or...
Return the trimmed string and the column offset to to adjust error location.
| Parameters | |
line:str | Undocumented |
max_len:int | Undocumented |
col:int | Undocumented |
min_width:int | Undocumented |
| Returns | |
Tuple[ | Undocumented |
Undocumented
| Parameters | |
dt:float | Undocumented |
serious:bool | Undocumented |
messages:List[ | Undocumented |
path:str | Undocumented |
version:str | Undocumented |
platform:str | Undocumented |
Undocumented
| Value |
|
Undocumented
| Value |
|
Undocumented
| Value |
|