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

nf-core pipeline lint gives cryptic prettier error message #3262

Open
marrip opened this issue Oct 29, 2024 · 1 comment
Open

nf-core pipeline lint gives cryptic prettier error message #3262

marrip opened this issue Oct 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@marrip
Copy link

marrip commented Oct 29, 2024

Description of the bug

I created a custom pipeline with nf-core tools with minimal features and tried linting it. There were some issues with tests which were easy to fix, however, prettier fails and gives some cryptic error message (see below). I am not sure where this tmp folder comes from and what prettier is actually complaining about. Is it possible to turn it off for the nf-core lint process?

Command used and terminal output

$ nf-core pipelines lint -d nf-core-nextflow

                                      ,--./,-.
      ___     __   __   __   ___     /,-._.--~\ 
|\ | |__  __ /  ` /  \ |__) |__         }  {
| \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                      `._,._,'

nf-core/tools version 3.0.2 - https://nf-co.re

INFO Testing pipeline: nf-core-nextflow
Running lint checks ━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2 of 23 » files_unchanged CRITICAL Can't format ['/tmp/tmp9hyoxp1p/nf-core-nextflow/modules.json', '/tmp/tmp9hyoxp1p/nf-core-nextflow/tower.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/CHANGELOG.md', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.prettierignore',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.editorconfig', '/tmp/tmp9hyoxp1p/nf-core-nextflow/conf', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.gitattributes',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.prettierrc.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/LICENSE', '/tmp/tmp9hyoxp1p/nf-core-nextflow/nextflow.config', '/tmp/tmp9hyoxp1p/nf-core-nextflow/assets',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules', '/tmp/tmp9hyoxp1p/nf-core-nextflow/workflows',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.gitpod.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.nf-core.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/docs',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.devcontainer', '/tmp/tmp9hyoxp1p/nf-core-nextflow/CITATIONS.md',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/CODE_OF_CONDUCT.md', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.pre-commit-config.yaml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.gitignore', '/tmp/tmp9hyoxp1p/nf-core-nextflow/nextflow_schema.json',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/main.nf', '/tmp/tmp9hyoxp1p/nf-core-nextflow/README.md',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/conf/igenomes.config', '/tmp/tmp9hyoxp1p/nf-core-nextflow/conf/test_full.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/conf/igenomes_ignored.config', '/tmp/tmp9hyoxp1p/nf-core-nextflow/conf/test.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/conf/modules.config', '/tmp/tmp9hyoxp1p/nf-core-nextflow/conf/base.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/local', '/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/schema_input.json', '/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/adaptivecard.json',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/methods_description_template.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/slackreport.json',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/email_template.html', '/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/nf-core-nextflow_logo_light.png',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/samplesheet.csv', '/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/multiqc_config.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/sendmail_template.txt', '/tmp/tmp9hyoxp1p/nf-core-nextflow/assets/email_template.txt',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/.dockstore.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/CONTRIBUTING.md', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/PULL_REQUEST_TEMPLATE.md',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/ISSUE_TEMPLATE', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/workflows/nextflow.nf', '/tmp/tmp9hyoxp1p/nf-core-nextflow/docs/usage.md',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/docs/images', '/tmp/tmp9hyoxp1p/nf-core-nextflow/docs/output.md',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/docs/README.md', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.devcontainer/devcontainer.json',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/local/utils_nfcore_nextflow_pipeline',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/local/utils_nfcore_nextflow_pipeline/main.nf',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin/meta.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin/tests',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin/main.nf',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/meta.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/tests',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/main.nf',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/meta.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/main.nf',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/awsfulltest.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/linting.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/awstest.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/linting_comment.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/template_version_comment.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/clean-up.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/ci.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/branch.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/fix-linting.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/release-announcements.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/workflows/download_pipeline.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/ISSUE_TEMPLATE/bug_report.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/ISSUE_TEMPLATE/feature_request.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/.github/ISSUE_TEMPLATE/config.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/meta.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/environment.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/tests',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/main.nf', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/meta.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/environment.yml', '/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/tests',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/main.nf',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/tests/main.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/tests/tags.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/tests/nextflow.config',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/multiqc/tests/main.nf.test.snap',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/tests/main.nf.test',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/tests/tags.yml',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/modules/nf-core/fastqc/tests/main.nf.test.snap',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/docs/images/nf-core-nextflow_logo_light.png',
'/tmp/tmp9hyoxp1p/nf-core-nextflow/docs/images/nf-core-nextflow_logo_dark.png'] because it has a syntax error.
prettier.................................................................Failed
- hook id: prettier
- exit code: 2

      ../../tmp/tmp9hyoxp1p/nf-core-nextflow/assets/adaptivecard.json: SyntaxError: Unexpected token (57:47)                                           
        55 |                                 {                                                                                                         
        56 |                                     "type": "FactSet",                                                                                    
      > 57 |                                     "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %> 
           |                                               ^                                                                                           
        58 |                                     ]                                                                                                     
        59 |                                 }                                                                                                         
        60 |                             ]                                                                                                             
                                                                                                                                                       
      ../../tmp/tmp9hyoxp1p/nf-core-nextflow/assets/slackreport.json: SyntaxError: Unexpected token (15:18)                                            
        13 |                     "short": false                                                                                                        
        14 |                 }                                                                                                                         
      > 15 |                 <%                                                                                                                        
           |                  ^                                                                                                                        
        16 |                     if (!success) { %>                                                                                                    
        17 |                     ,                                                                                                                     
        18 |                     {                                                                                                                     
     ../../tmp/tmp9hyoxp1p/nf-core-nextflow/assets/email_template.html                                                                                 
     ../../tmp/tmp9hyoxp1p/nf-core-nextflow/.nf-core.yml

System information

No response

@marrip marrip added the bug Something isn't working label Oct 29, 2024
@mirpedrol
Copy link
Member

Hi @marrip,

We usually set prettier to skip these json files as they can not be linted by prettier. The .prettierignore file containing this:

email_template.html
adaptivecard.json
slackreport.json
.nextflow*
work/
data/
results/
.DS_Store
testing/
testing*
*.pyc
bin/

I guess you ticked off the feature of code linters? And that's why you don't have this file. When are you seeing this error? Because we don't run prettier with the nf-core pipelines lint command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants