stubber.utils.post
¶
Pre/Post Processing for createstubs.py
Module Contents¶
Functions¶
|
Common post processing |
|
run black to format the code / stubs |
|
run autoflake to remove unused imports |
- stubber.utils.post.do_post_processing(stub_paths: List[pathlib.Path], pyi: bool, black: bool)¶
Common post processing
- Parameters
stub_paths (List[pathlib.Path]) –
pyi (bool) –
black (bool) –
- stubber.utils.post.run_black(path: pathlib.Path, capture_output=False)¶
run black to format the code / stubs
- Parameters
path (pathlib.Path) –
- stubber.utils.post.run_autoflake(path: pathlib.Path, capture_output=False, progress_pyi=False)¶
run autoflake to remove unused imports needs to be run BEFORE black otherwise it does not recognize long import from`s. note: is run file-by-file to include processing .pyi files
- Parameters
path (pathlib.Path) –