Skip to content

Commit

Permalink
Enable flake8-logging-format and flake8-implicit-str-concat ruff rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Apr 30, 2024
1 parent 059dbce commit 15fba27
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion bioblend/galaxy/dataset_collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ def wait_for_dataset_collection(
return dataset_collection
if time_left > 0:
log.info(
f"The dataset collection {dataset_collection_id} has {len(terminal_states)} out of {len(states)} datasets in a terminal state. Will wait {time_left} more s"
"The dataset collection %s has %s out of %s datasets in a terminal state. Will wait %s more s",
dataset_collection_id,
len(terminal_states),
len(states),
time_left,
)
time.sleep(min(time_left, interval))
time_left -= interval
Expand Down
2 changes: 1 addition & 1 deletion bioblend/galaxy/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def wait_for_dataset(
raise Exception(f"Dataset {dataset_id} is in terminal state {state}")
return dataset
if time_left > 0:
log.info(f"Dataset {dataset_id} is in non-terminal state {state}. Will wait {time_left} more s")
log.info("Dataset %s is in non-terminal state %s. Will wait %s more s", dataset_id, state, time_left)
time.sleep(min(time_left, interval))
time_left -= interval
else:
Expand Down
4 changes: 3 additions & 1 deletion bioblend/galaxy/invocations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ def wait_for_invocation(
raise Exception(f"Invocation {invocation_id} is in terminal state {state}")
return invocation
if time_left > 0:
log.info(f"Invocation {invocation_id} is in non-terminal state {state}. Will wait {time_left} more s")
log.info(
"Invocation %s is in non-terminal state %s. Will wait %s more s", invocation_id, state, time_left
)
time.sleep(min(time_left, interval))
time_left -= interval
else:
Expand Down
2 changes: 1 addition & 1 deletion bioblend/galaxy/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def wait_for_job(
raise Exception(f"Job {job_id} is in terminal state {state}")
return job
if time_left > 0:
log.info(f"Job {job_id} is in non-terminal state {state}. Will wait {time_left} more s")
log.info("Job %s is in non-terminal state %s. Will wait %s more s", job_id, state, time_left)
time.sleep(min(time_left, interval))
time_left -= interval
else:
Expand Down
2 changes: 1 addition & 1 deletion bioblend/galaxy/objects/galaxy_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def poll(ds_list: Iterable[wrappers.Dataset]) -> List[wrappers.Dataset]:
if not ds.state:
self.log.warning("Dataset %s has an empty state", ds.id)
elif ds.state not in TERMINAL_STATES:
self.log.info(f"Dataset {ds.id} is in non-terminal state {ds.state}")
self.log.info("Dataset %s is in non-terminal state %s", ds.id, ds.state)
pending.append(ds)
return pending

Expand Down
2 changes: 1 addition & 1 deletion bioblend/galaxyclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
found_scheme = None
# Try to guess the scheme, starting from the more secure
for scheme in ("https://", "http://"):
log.warning(f"Missing scheme in url, trying with {scheme}")
log.warning("Missing scheme in url, trying with %s", scheme)
with contextlib.suppress(requests.RequestException):
r = requests.get(
scheme + url,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ isort = true
target-version = "py38"

[tool.ruff.lint]
select = ["E", "F", "B", "C4", "UP"]
select = ["E", "F", "B", "C4", "G", "ISC", "UP"]
# Exceptions:
# B9 flake8-bugbear opinionated warnings
# E501 is line length (delegated to black)
Expand Down

0 comments on commit 15fba27

Please sign in to comment.