I'm getting similar errors as the ones reported in...
# tools
p
I'm getting similar errors as the ones reported in this thread when using the
nf-core pipelines lint
command on a new pipeline created using the following template.yaml:
Copy code
author: me
description: A test pipeline
force: false
is_nfcore: false
name: pipeline_name
org: myorg
outdir: .
skip_features:
- adaptivecard
- codespaces
- gpu
- igenomes
- seqera_platform
- slackreport
- vscode
version: 1.0.0dev
The particular errors are to do with
adaptivecard.json
,
nf-test.yml
and
slackreport.json
. Any ideas on what I can do to fix this? ``````
Full output log in case it helps!
m
Can you add the assets folder to .prettierignore?
a
I've made an issue for this recently
https://github.com/nf-core/tools/issues/3927 Full explanation of why this happens and possible fixes contained within.
p
@mashehu :Adding the entire assets folder indeed fixes the error. Adding the individual files doesn't. @Arthur: Oh! I'm afraid some parts of that explanation (including the potential fix) went straight over my head (likely because I'm not familiar with how the linting functionality is implemented). So let me recap my understanding: • the real pipeline directory lacks the
slackreport.json
and
adaptivecard.json
(matching the template yaml), and so these files are not listed in
.prettierignore
nor in `.nf-core.yml`'s
files_unchanged
section. • During the linting check, a new temporary pipeline is created to compare against, using a template yaml with all optional components (i.e. with the slack and adaptive json files), including a
.prettierignore
file that has all these components listed, and no special rules in its
.nf-core.yml
. • Where I got lost: ◦
run_prettier_on_file
is run on all files in...the real directory? Or the template? I assume the former, because that's what should be linted? ◦ that function erroneously checks if the current work dir is a git directory instead of the directory storing the files it's iterating through. But if the previous question is the real directory, this should be fine? ◦ why is prettier erroring out on these particular files anyway?
Whilst this can be fixed by passing the correct template yml when creating the temporary pipeline, that would not prevent the unintended side-effect of the prettier lining running because the working directory is the current pipeline directory and not the temporary one.
So prettier is not intended to be part of the linting, but is an automatic byproduct of initializing the temporary pipeline created for the linting comparison?
a
Prettier gets run on the template directory during the linting of
files_unchanged
specifically
Essentially though, yes this a byproduct of the temporary pipeline creation
🤔 1