Skip to content

Commit 2f71183

Browse files
authored
Merge pull request #3413 from nf-core/renovate/astral-sh-ruff-pre-commit-0.x
Update pre-commit hook astral-sh/ruff-pre-commit to v0.9.3
2 parents 3be4b60 + 61d9710 commit 2f71183

File tree

16 files changed

+37
-36
lines changed

16 files changed

+37
-36
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.8.6
3+
rev: v0.9.3
44
hooks:
55
- id: ruff # linter
66
args: [--fix, --exit-non-zero-on-fix] # sort imports and fix

nf_core/components/components_differ.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,7 @@ def print_diff(
271271
console = Console(force_terminal=nf_core.utils.rich_force_colors())
272272
if current_version is not None and new_version is not None:
273273
log.info(
274-
f"Changes in component '{Path(repo_path, component)}' between"
275-
f" ({current_version}) and"
276-
f" ({new_version})"
274+
f"Changes in component '{Path(repo_path, component)}' between ({current_version}) and ({new_version})"
277275
)
278276
else:
279277
log.info(f"Changes in component '{Path(repo_path, component)}'")

nf_core/components/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ def generate_component_info_help(self):
265265
intro_text.append(
266266
Text.from_markup(
267267
":globe_with_meridians: Repository: "
268-
f"{ '[link={self.remote_location}]' if self.remote_location.startswith('http') else ''}"
268+
f"{'[link={self.remote_location}]' if self.remote_location.startswith('http') else ''}"
269269
f"{self.remote_location}"
270-
f"{'[/link]' if self.remote_location.startswith('http') else '' }"
270+
f"{'[/link]' if self.remote_location.startswith('http') else ''}"
271271
"\n"
272272
)
273273
)

nf_core/components/lint/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def __init__(
102102
continue
103103
if isinstance(components, str):
104104
raise LookupError(
105-
f"Error parsing modules.json: {components}. " f"Please check the file for errors or try again."
105+
f"Error parsing modules.json: {components}. Please check the file for errors or try again."
106106
)
107107
for org, comp in components:
108108
self.all_remote_components.append(

nf_core/components/remove.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,6 @@ def remove(self, component, removed_by=None, removed_components=None, force=Fals
176176
f"Did not remove '{component}', because it was also manually installed. Only updated 'installed_by' entry in modules.json."
177177
)
178178
log.info(
179-
f"""Did not remove {self.component_type[:-1]} '{component}', because it was also installed by {', '.join(f"'{d}'" for d in installed_by)}. Only updated the 'installed_by' entry in modules.json."""
179+
f"""Did not remove {self.component_type[:-1]} '{component}', because it was also installed by {", ".join(f"'{d}'" for d in installed_by)}. Only updated the 'installed_by' entry in modules.json."""
180180
)
181181
return removed

nf_core/modules/lint/meta_yml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
6262
).get("meta.yml")
6363
if lines is not None:
6464
yaml = ruamel.yaml.YAML()
65-
meta_yaml = yaml.safe_load("".join(lines))
65+
meta_yaml = yaml.load("".join(lines))
6666
if meta_yaml is None:
6767
module.failed.append(("meta_yml_exists", "Module `meta.yml` does not exist", module.meta_yml))
6868
return
@@ -82,7 +82,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
8282
if len(e.path) > 0:
8383
hint = f"\nCheck the entry for `{e.path[0]}`."
8484
if e.message.startswith("None is not of type 'object'") and len(e.path) > 2:
85-
hint = f"\nCheck that the child entries of {str(e.path[0])+'.'+str(e.path[2])} are indented correctly."
85+
hint = f"\nCheck that the child entries of {str(e.path[0]) + '.' + str(e.path[2])} are indented correctly."
8686
if e.schema and isinstance(e.schema, dict) and "message" in e.schema:
8787
e.message = e.schema["message"]
8888
incorrect_value = meta_yaml

nf_core/pipelines/download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def download_workflow(self):
202202
raise DownloadError(e) from e
203203

204204
summary_log = [
205-
f"Pipeline revision: '{', '.join(self.revision) if len(self.revision) < 5 else self.revision[0]+',['+str(len(self.revision)-2)+' more revisions],'+self.revision[-1]}'",
205+
f"Pipeline revision: '{', '.join(self.revision) if len(self.revision) < 5 else self.revision[0] + ',[' + str(len(self.revision) - 2) + ' more revisions],' + self.revision[-1]}'",
206206
f"Use containers: '{self.container_system}'",
207207
]
208208
if self.container_system:
@@ -1908,8 +1908,8 @@ def __init__(
19081908

19091909
log.error(self.error_type.message)
19101910
log.info(self.error_type.helpmessage)
1911-
log.debug(f'Failed command:\n{" ".join(singularity_command)}')
1912-
log.debug(f'Singularity error messages:\n{"".join(error_msg)}')
1911+
log.debug(f"Failed command:\n{' '.join(singularity_command)}")
1912+
log.debug(f"Singularity error messages:\n{''.join(error_msg)}")
19131913

19141914
raise self.error_type
19151915

nf_core/pipelines/lint/multiqc_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def multiqc_config(self) -> Dict[str, List[str]]:
122122
f"The expected comment is: \n"
123123
f"```{hint}``` \n"
124124
f"The current comment is: \n"
125-
f"```{ mqc_yml['report_comment'].strip()}```"
125+
f"```{mqc_yml['report_comment'].strip()}```"
126126
)
127127
else:
128128
passed.append("`assets/multiqc_config.yml` contains a matching 'report_comment'.")

nf_core/pipelines/lint/version_consistency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def version_consistency(self):
5353
# Check if they are consistent
5454
if len(set(versions.values())) != 1:
5555
failed.append(
56-
"The versioning is not consistent between container, release tag " "and config. Found {}".format(
56+
"The versioning is not consistent between container, release tag and config. Found {}".format(
5757
", ".join([f"{k} = {v}" for k, v in versions.items()])
5858
)
5959
)

nf_core/pipelines/params_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"of nextflow run with the {pipeline_name} pipeline."
2020
)
2121

22-
USAGE = "Uncomment lines with a single '#' if you want to pass the parameter " "to the pipeline."
22+
USAGE = "Uncomment lines with a single '#' if you want to pass the parameter to the pipeline."
2323

2424
H1_SEPERATOR = "## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
2525
H2_SEPERATOR = "## ----------------------------------------------------------------------------"
@@ -107,7 +107,7 @@ def get_pipeline(self) -> Optional[bool]:
107107
# Prompt for pipeline if not supplied
108108
if self.pipeline is None:
109109
launch_type = questionary.select(
110-
"Generate parameter file for local pipeline " "or remote GitHub pipeline?",
110+
"Generate parameter file for local pipeline or remote GitHub pipeline?",
111111
choices=["Remote pipeline", "Local path"],
112112
style=nf_core.utils.nfcore_question_style,
113113
).unsafe_ask()

0 commit comments

Comments
 (0)