From d84ebf4ad74e0b31a518eec1d6bae36e5995ca42 Mon Sep 17 00:00:00 2001 From: Vlad Emelianov Date: Wed, 27 Nov 2024 00:55:13 +0300 Subject: [PATCH] Update sanity check --- mypy_boto3_builder/utils/strings.py | 2 +- pyproject.toml | 1 - scripts/check_output.py | 38 +++++++++-------------------- tests/utils/test_strings.py | 2 +- 4 files changed, 14 insertions(+), 29 deletions(-) diff --git a/mypy_boto3_builder/utils/strings.py b/mypy_boto3_builder/utils/strings.py index c9eb4428..ccecd8b2 100644 --- a/mypy_boto3_builder/utils/strings.py +++ b/mypy_boto3_builder/utils/strings.py @@ -25,7 +25,7 @@ *keyword.kwlist, } AWS_LINK_RE: Final = re.compile(r"`([^`]+\S)\s*`\_*") -REPLACE_DOCSTRING_CHARS: Final = MappingProxyType({"’": "'", "–": "-"}) +REPLACE_DOCSTRING_CHARS: Final = MappingProxyType({"’": "'", "–": "-", " ": " "}) # noqa: RUF001 def get_class_prefix(func_name: str) -> str: diff --git a/pyproject.toml b/pyproject.toml index 0356ef0e..e1df7297 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -179,7 +179,6 @@ fixable = ["ALL"] unfixable = ["B"] dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" exclude = ["*.pyi", "examples/*", "aio_examples/*"] -allowed-confusables = ["’", "–"] [tool.ruff.lint.per-file-ignores] "test_*.py" = [ diff --git a/scripts/check_output.py b/scripts/check_output.py index 64f9fa68..f2a0969e 100755 --- a/scripts/check_output.py +++ b/scripts/check_output.py @@ -141,7 +141,6 @@ def run_ruff(path: Path) -> None: "B", "I", "N", - "D", "C4", "C90", "RUF", @@ -167,31 +166,18 @@ def run_ruff(path: Path) -> None: "FURB", ] ignore_errors = [ - "A002", - "B014", - "D200", - "D101", - "D102", - "D105", - "D107", - "D203", - "D205", - "D212", - "D400", - "D401", - "D403", - "D404", - "D415", - "D418", - "E203", - "E501", - "N802", - "N803", - "N812", - "PYI036", - "RET503", - "UP004", - "UP013", + "A002", # builtin-argument-shadowing + "B014", # duplicate-handler-exception + "E203", # whitespace-before-comment + "E501", # line-too-long + "E741", # ambiguous-variable-name + "N802", # invalid-function-name + "N803", # invalid-argument-name + "N812", # lowercase-imported-as-non-lowercase + "PYI036", # bad-exit-annotation + "RET503", # implicit-return + "UP004", # useless-object-inheritance + "UP013", # convert-typed-dict-functional-to-class ] with tempfile.NamedTemporaryFile("w+b") as f: try: diff --git a/tests/utils/test_strings.py b/tests/utils/test_strings.py index 369ff32b..07f4491c 100644 --- a/tests/utils/test_strings.py +++ b/tests/utils/test_strings.py @@ -36,7 +36,7 @@ def test_get_short_docstring(self) -> None: assert not get_short_docstring("") assert not get_short_docstring("\n") assert get_short_docstring("`asd\n:type") == "`asd`." - assert get_short_docstring("`as’d\n:type") == "`as'd`." + assert get_short_docstring("`as’d\n:type") == "`as'd`." # noqa: RUF001 assert ( get_short_docstring("`asd `\n **Request syntax**::\ntest") == "[asd](https://link)."