summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorr-richmond <rrichmond.gh@gmail.com>2020-07-12 20:18:38 -0700
committerr-richmond <rrichmond.gh@gmail.com>2020-07-12 20:18:38 -0700
commit793c569f371657537ceff289351a748aa3f0374b (patch)
tree08e769cdb84b228ac7ec3cc79e4ab614a43e96e3 /scripts
parente587e21ef5070a9e35826b9cd4b22d7aa83b2f18 (diff)
downloadisort-793c569f371657537ceff289351a748aa3f0374b.tar.gz
second cleanup pass
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_config_option_docs.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/scripts/build_config_option_docs.py b/scripts/build_config_option_docs.py
index 3dbc41f5..5cf3fd99 100755
--- a/scripts/build_config_option_docs.py
+++ b/scripts/build_config_option_docs.py
@@ -36,34 +36,37 @@ class Example:
def __post_init__(self):
if self.cfg or self.pyproject_toml or self.cli:
if self.cfg:
+ cfg = dedent(self.cfg).lstrip()
self.cfg = dedent(
- f"""
+ """
### Example `.isort.cfg`
```
- {self.cfg}
+ {cfg}
```
"""
- )
+ ).format(cfg=cfg)
if self.pyproject_toml:
+ pyproject_toml = dedent(self.pyproject_toml).lstrip()
self.pyproject_toml = dedent(
- f"""
+ """
### Example `pyproject.toml`
```
- {self.pyproject_toml}
+ {pyproject_toml}
```
"""
- )
+ ).format(pyproject_toml=pyproject_toml)
if self.cli == "":
+ cli = dedent(self.cli).lstrip()
self.cli = dedent(
- f"""
+ """
### Example cli usage
- `{self.cli}`
+ `{cli}`
"""
- )
+ ).format(cli=cli)
self.section_complete = f"""**Examples:**
@@ -81,9 +84,10 @@ class Example:
example_mapping: Dict[str, Example]
example_mapping = {
"known_other": Example(
- pyproject_toml="""[tool.isort]
- sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'AIRFLOW', 'FIRSTPARTY', 'LOCALFOLDER']
- known_airflow = ['airflow']"""
+ pyproject_toml="""
+ [tool.isort]
+ sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'AIRFLOW', 'FIRSTPARTY', 'LOCALFOLDER']
+ known_airflow = ['airflow']"""
)
}