Skip to content

Commit

Permalink
Enable ignore-without-code mypy error code
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Sep 26, 2024
1 parent 00ec042 commit 79a4ebd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/celery/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GalaxyTaskBeforeStartUserRateLimitPostgres(GalaxyTaskBeforeStartUserRateLi
We take advantage of efficiencies in its dialect.
"""

def calculate_task_start_time( # type: ignore
def calculate_task_start_time(
self, user_id: int, sa_session: galaxy_scoped_session, task_interval_secs: float, now: datetime.datetime
) -> datetime.datetime:
with transaction(sa_session):
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,7 @@ class HDACustom(HDADetailed):
# TODO: Fix this workaround for partial_model not supporting UUID fields for some reason.
# The error otherwise is: `PydanticUserError: 'UuidVersion' cannot annotate 'nullable'.`
# Also ignoring mypy complaints about the type redefinition.
uuid: Optional[UUID4] # type: ignore
uuid: Optional[UUID4] # type: ignore[assignment]

# Add fields that are not part of any view here
visualizations: Annotated[
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/webapps/galaxy/api/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
List,
Literal,
Optional,
Set,
Union,
)

Expand Down Expand Up @@ -335,11 +336,10 @@ def parse_content_types(types: Union[List[str], str]) -> List[HistoryContentType
def parse_dataset_details(details: Optional[str]):
"""Parses the different values that the `dataset_details` parameter
can have from a string."""
dataset_details = None
if details is not None and details != "all":
dataset_details = set(util.listify(details))
dataset_details: Union[None, Set[str], str] = set(util.listify(details))
else: # either None or 'all'
dataset_details = details # type: ignore
dataset_details = details
return dataset_details


Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[mypy]
enable_error_code = ignore-without-code
plugins = pydantic.mypy
show_error_codes = True
ignore_missing_imports = True
Expand Down
4 changes: 2 additions & 2 deletions tools/filters/sff_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
fake_sff_name = "fake_sff_name"

# readname as key: lines with matches from SSAHA, one best match
ssahapematches = {} # type: ignore
ssahapematches = {} # type: ignore[var-annotated]
# linker readname as key: length of linker sequence
linkerlengths = {} # type: ignore
linkerlengths = {} # type: ignore[var-annotated]

# set to true if something really fishy is going on with the sequences
stern_warning = False
Expand Down

0 comments on commit 79a4ebd

Please sign in to comment.