Skip to content

Commit

Permalink
Replace static joins with f-strings
Browse files Browse the repository at this point in the history
Activates FLY rules for ruff.
  • Loading branch information
ogenstad committed Jan 17, 2025
1 parent 6a4906c commit badbe72
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion infrahub_sdk/pytest_plugin/items/graphql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def repr_failure(self, excinfo: ExceptionInfo, style: str | None = None) -> str:
)

if isinstance(excinfo.value, OutputMatchError):
return "\n".join([excinfo.value.message, excinfo.value.differences])
return f"{excinfo.value.message}\n{excinfo.value.differences}"

Check warning on line 43 in infrahub_sdk/pytest_plugin/items/graphql_query.py

View check run for this annotation

Codecov / codecov/patch

infrahub_sdk/pytest_plugin/items/graphql_query.py#L43

Added line #L43 was not covered by tests

return super().repr_failure(excinfo, style=style)

Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/pytest_plugin/items/jinja2_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def repr_failure(self, excinfo: ExceptionInfo, style: str | None = None) -> str:
return "\n".join(["Syntax error detected in the template", excinfo.value.message or ""])

if isinstance(excinfo.value, OutputMatchError):
return "\n".join([excinfo.value.message, excinfo.value.differences])
return f"{excinfo.value.message}\n{excinfo.value.differences}"

return super().repr_failure(excinfo, style=style)

Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/pytest_plugin/items/python_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def repr_failure(self, excinfo: ExceptionInfo, style: str | None = None) -> str:
)

if isinstance(excinfo.value, OutputMatchError):
return "\n".join([excinfo.value.message, excinfo.value.differences])
return f"{excinfo.value.message}\n{excinfo.value.differences}"

Check warning on line 65 in infrahub_sdk/pytest_plugin/items/python_transform.py

View check run for this annotation

Codecov / codecov/patch

infrahub_sdk/pytest_plugin/items/python_transform.py#L65

Added line #L65 was not covered by tests

return super().repr_failure(excinfo, style=style)

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ ignore = [
"TID", # flake8-tidy-imports
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"FLY", # flynt
"RSE", # flake8-raise
"BLE", # flake8-blind-except (BLE)
"A", # flake8-builtins
Expand Down

0 comments on commit badbe72

Please sign in to comment.