Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Ruff ignore rule UP034 (pyupgrade) #1553

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/questionnaire/questionnaire_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def serialize(cls, data: Any) -> Any:
@classmethod
def get_mutable_deepcopy(cls, data: Any) -> Any:
if isinstance(data, tuple):
return list((cls.get_mutable_deepcopy(item) for item in data))
return [cls.get_mutable_deepcopy(item) for item in data]
if isinstance(data, ImmutableDict):
key_value_tuples = {k: cls.get_mutable_deepcopy(v) for k, v in data.items()}
return dict(key_value_tuples)
Expand Down
8 changes: 3 additions & 5 deletions app/questionnaire/questionnaire_store_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ def save(self) -> None:

def is_dirty(self) -> bool:
return bool(
(
self._answer_store.is_dirty
or self._list_store.is_dirty
or self._progress_store.is_dirty
)
self._answer_store.is_dirty
or self._list_store.is_dirty
or self._progress_store.is_dirty
)

def update_relationships_answer(
Expand Down
2 changes: 1 addition & 1 deletion app/utilities/make_immutable.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def make_immutable(data: Any) -> Any:
if isinstance(data, abc.Hashable):
return data
if isinstance(data, list):
return tuple((make_immutable(item) for item in data))
return tuple(make_immutable(item) for item in data)
if isinstance(data, dict):
key_value_tuples = {k: make_immutable(v) for k, v in data.items()}
return ImmutableDict(key_value_tuples)
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ extend-ignore = [
"EM102", # EM102 Exception must not use an f-string literal, assign to variable first
"UP032", # Use f-string instead of `format` call
"UP018", # Unnecessary {literal_type} call (rewrite as a literal)
"UP034", # Avoid extraneous parentheses
"UP015", # Unnecessary open mode parameters
"UP007", # Use `X | Y` for type annotations
"UP006", # Use `type` instead of `Type` for type annotation
Expand Down