formate.mini_hooks
¶
Small but mighty hooks.
Functions:
|
Check the source can be parsed as a Python Abstract Syntax Tree. |
|
Pull |
|
Squash type stubs by removing unnecessary blank lines. |
-
check_ast
(source)[source]¶ Check the source can be parsed as a Python Abstract Syntax Tree.
- Parameters
source (
str
) – The source to check.- Raises
SyntaxError – If the source is not valid Python.
- Return type
- Returns
The source unchanged.
-
noqa_reformat
(source)[source]¶ Pull
# noqa: ...
comments that immediately follow docstrings back up to the end of the correct line.