Utils#
Mypy_boto3_builder Index / Mypy Boto3 Builder / Writers / Utils
Auto-generated documentation for mypy_boto3_builder.writers.utils module.
blackify#
Format content
with black
if file_path
is *.py
or *.pyi
.
On error writes invalid content
to file_path
to check for errors.
Arguments#
content
- Python code to format.file_path
- Target file path.
Returns#
Formatted python code.
Raises#
ValueError
- Ifcontent
is not a valid Python code.
Signature#
blackify_markdown#
Blackify python codeblocks.
Signature#
format_md#
Format MarkDown with mdformat.
Signature#
insert_md_toc#
Insert Table of Contents before the first second-level header.
Signature#
render_jinja2_package_template#
Render Jinja2 package template to a string.
Arguments#
template_path
- Relative path to template inTEMPLATES_PATH
package
- Service or wrapper package
Returns#
A rendered template.
Signature#
See also#
sort_imports#
Sort imports with isort
.
Arguments#
content
- File content.module_name
- Current module name.extension
- py or pyithird_party
- List of module names to be marked as third-party.
Returns#
New file content.