Skip to content

Commit

Permalink
Replace ambiguous chars in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Apr 24, 2024
1 parent 635aed6 commit 1c5c18d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mypy_boto3_builder/utils/strings.py
Expand Up @@ -17,6 +17,7 @@
}
MAX_DOCSTRING_LENGTH: int = 300
AWS_LINK_RE = re.compile(r"`([^`]+\S)\s*<https://(\S+)>`\_*")
REPLACE_DOCSTRING_CHARS = {"’": "'"} # noqa


def get_class_prefix(func_name: str) -> str:
Expand Down Expand Up @@ -92,6 +93,10 @@ def clean_artifacts(line: str) -> str:
if line and not line.endswith("."):
line = f"{line}."

for ch, replacement in REPLACE_DOCSTRING_CHARS.items():
if ch in line:
line = line.replace(ch, replacement)

if "<https:" in line:
line = AWS_LINK_RE.sub(r"[\g<1>](https://\g<2>)", line)
# FIXME: temporary fix for pca-connector-ad service
Expand Down
1 change: 0 additions & 1 deletion scripts/check_output.py
Expand Up @@ -142,7 +142,6 @@ def run_ruff(path: Path) -> None:
"E501",
"N802",
"N803",
"RUF002",
]
with tempfile.NamedTemporaryFile("w+b") as f:
try:
Expand Down

0 comments on commit 1c5c18d

Please sign in to comment.