api¶
- class svst.api.get_lines_to_ignore(code)[source]¶
Read lines to ignore in a string of source code.
- Parameters:
code (
str) – String of source code.- Return type:
List[int]- Returns:
List of lines to ignore.
- class svst.api.parse_code(code, file_name=None)[source]¶
Parse code directly and return a list of output dictionaries.
- Parameters:
code (
str) – String of python code.file_name (
Optional[str]) – Path of the file being analysed.
- Return type:
Iterator[OutputTypedDict]- Returns:
A list of OutputTypedDict that contain the info of the svst error.
- class svst.api.mypy_run(path)[source]¶
Use mypy api to analyse a path.
- Parameters:
path (
str) – File or directory path string.- Yields:
mypy error string.
- Return type:
List[str]
- class svst.api.run(path_list, mypy=False)[source]¶
Run path list.
- Parameters:
path_list (
List[str]) – List of path strings.mypy (
bool) – Run mypy for the same path_list.
- Yields:
str – {file_name}:{line_number}: error: Variable “{variable_name}” is missing a standalone variable type annotation in the scope “{variable_scope}” [no-untyped-var]
- Return type:
List[str]