Skip to content

Commit 3fe7997

Browse files
committed
chore: re-enable ruff rules
1 parent 5a6b760 commit 3fe7997

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,17 @@ ignore = [
8686
"ANN102", # no type for cls
8787
"SIM108", # allow if-else in place of ternary
8888
"RET505", # allow else after return
89-
"PLR0911", # TODO: re-enable
90-
"PLR2004", # TODO: re-enable
91-
"ARG001", # TODO: re-enable
9289
]
9390
# Exclude a variety of commonly ignored directories.
9491
extend-exclude = [
95-
"docs",
96-
"examples"
92+
"docs"
9793
]
9894
# Assume Python 3.10.
9995
target-version = "py310"
10096

97+
[tool.ruff.per-file-ignores]
98+
"src/algokit_client_generator/generator.py" = ["ARG001"]
99+
101100
[tool.ruff.flake8-annotations]
102101
allow-star-arg-any = true
103102
suppress-none-returning = true
@@ -113,7 +112,7 @@ pythonpath = ["src", "tests"]
113112

114113
[tool.mypy]
115114
files = ["src", "tests"]
116-
exclude = ["dist", "examples"]
115+
exclude = ["dist"]
117116
python_version = "3.10"
118117
warn_unused_ignores = true
119118
warn_redundant_casts = true

src/algokit_client_generator/document.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Part(Enum):
1616

1717
DocumentPart = str | Part
1818
DocumentParts = DocumentPart | Iterable["DocumentParts"]
19+
_MINIMUM_RENDERED_LENGTH = 5
1920

2021

2122
class RenderContext:
@@ -32,7 +33,7 @@ def line_mode(self) -> str:
3233
return self.line_mode_stack[-1]
3334

3435

35-
def convert_part_inner(part: DocumentPart, context: RenderContext) -> str | None:
36+
def convert_part_inner(part: DocumentPart, context: RenderContext) -> str | None: # noqa: ignore[PLR0911]
3637
match part:
3738
case Part.IncIndent:
3839
context.indent += context.indent_inc
@@ -89,7 +90,7 @@ def convert_part(parts: DocumentParts, context: RenderContext) -> list[str]:
8990
result = convert_part_inner(part, context)
9091
context.last_part = part
9192
if result is not None:
92-
if len(result) > 5:
93+
if len(result) > _MINIMUM_RENDERED_LENGTH:
9394
context.last_rendered_part = result
9495
else: # if last render was small then combine
9596
context.last_rendered_part += result

src/algokit_client_generator/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_method_name(name: str, string_suffix: str = "") -> str:
2323
return "_".join(p for p in parts)
2424

2525

26-
def map_abi_type_to_python(abi_type: str) -> str:
26+
def map_abi_type_to_python(abi_type: str) -> str: # noqa: ignore[PLR0911]
2727
match = re.match(r".*\[([0-9]*)]$", abi_type)
2828
if match:
2929
array_size = match.group(1)

0 commit comments

Comments
 (0)