Skip to content

Commit

Permalink
Merge pull request #4431 from opsmill/pog-sim210
Browse files Browse the repository at this point in the history
Remove unnecessary `True if ... else False` (SIM210)
  • Loading branch information
ogenstad authored Sep 24, 2024
2 parents f6a63a5 + 3b90c4f commit b2f52fc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/tests/scale/common/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def request_event_handler(
"name": name,
"start_time": f"{start_time:.2f}",
"response_time": f"{response_time:.2f}ms",
"failed": True if exception else False,
"failed": bool(exception),
}

if exception:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ ignore = [
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SIM118", # Use `key in dict` instead of `key in dict.keys()`
"SIM201", # Use `backup_path.suffix != ".backup"` instead of `not backup_path.suffix == ".backup"`
"SIM210", # Remove unnecessary `True if ... else False`
"SIM300", # Yoda condition detected
"SIM401", # Use `property["items"].get("format", None)` instead of an `if` block
"SIM910", # Use `data.get("identifier")` instead of `data.get("identifier", None)`
Expand Down
4 changes: 1 addition & 3 deletions tasks/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ def _generate_infrahub_repository_configuration_documentation() -> None:

for name, definition in schema["$defs"].items():
for property, value in definition["properties"].items():
definitions[name]["properties"][property]["required"] = (
True if property in definition["required"] else False
)
definitions[name]["properties"][property]["required"] = property in definition["required"]
if "anyOf" in value:
definitions[name]["properties"][property]["type"] = ", ".join(
[i["type"] for i in value["anyOf"] if i["type"] != "null"]
Expand Down

0 comments on commit b2f52fc

Please sign in to comment.