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 · 7 comments
Open

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

marrip opened this issue Oct 29, 2024 · 7 comments
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.

@marrip
Copy link
Author

marrip commented Oct 30, 2024

Hey @mirpedrol!

Yes, I ticked off all features so I think the .prettierignore file does not exist. I got the error when I ran nf-core pipelines lint, I was also a bit baffled when I saw that it tried to run prettier. I did nf-core pipelines lint -d nf-core-nextflow (nf-core-nextflow is the directory with my minimal pipeline).

@marrip
Copy link
Author

marrip commented Oct 30, 2024

I added the .prettierignore file but it still gives me the same error when I run nf-core pipelines lint -d nf-core-nextflow

@awgymer
Copy link
Contributor

awgymer commented Oct 30, 2024

What is the content of your .nf-core.yml file for this pipeline?

@marrip
Copy link
Author

marrip commented Oct 30, 2024

bump_version: null
lint:
  base_config: false
  files_exist:
    - .github/ISSUE_TEMPLATE/bug_report.yml
    - .github/ISSUE_TEMPLATE/feature_request.yml
    - .github/PULL_REQUEST_TEMPLATE.md
    - .github/CONTRIBUTING.md
    - .github/.dockstore.yml
    - .github/workflows/branch.yml
    - .github/workflows/ci.yml
    - .github/workflows/linting_comment.yml
    - .github/workflows/linting.yml
    - conf/igenomes.config
    - conf/igenomes_ignored.config
    - conf/igenomes.config
    - .editorconfig
    - .prettierignore
    - .prettierrc.yml
    - CITATIONS.md
    - assets/multiqc_config.yml
    - conf/base.config
    - conf/modules.config
    - modules.json
    - CHANGELOG.md
    - nextflow_schema.json
    - LICENSE
    - assets/email_template.html
    - assets/sendmail_template.txt
    - assets/email_template.txt
    - docs/output.md
    - docs/README.md
    - docs/usage.md
    - conf/test.config
    - conf/test_full.config
    - .gitattributes
    - .github/workflows/ci.yml
    - .github/ISSUE_TEMPLATE/bug_report.yml
    - .github/ISSUE_TEMPLATE/feature_request.yml
    - .github/PULL_REQUEST_TEMPLATE.md
    - .github/CONTRIBUTING.md
    - .github/.dockstore.yml
    - .github/workflows/branch.yml
    - .github/workflows/ci.yml
    - .github/workflows/linting_comment.yml
    - .github/workflows/linting.yml
    - conf/igenomes.config
    - conf/igenomes_ignored.config
    - .editorconfig
    - .prettierignore
    - .prettierrc.yml
    - CITATIONS.md
    - assets/multiqc_config.yml
    - conf/base.config
    - conf/modules.config
    - modules.json
    - CHANGELOG.md
    - nextflow_schema.json
    - LICENSE
    - assets/email_template.html
    - assets/sendmail_template.txt
    - assets/email_template.txt
    - docs/output.md
    - docs/README.md
    - docs/usage.md
    - conf/test.config
    - conf/test_full.config
    - .github/workflows/ci.yml
    - CODE_OF_CONDUCT.md
    - assets/nf-core-nextflow_logo_light.png
    - docs/images/nf-core-nextflow_logo_light.png
    - docs/images/nf-core-nextflow_logo_dark.png
    - .github/ISSUE_TEMPLATE/config.yml
    - .github/workflows/awstest.yml
    - .github/workflows/awsfulltest.yml
  files_unchanged:
    - .github/ISSUE_TEMPLATE/bug_report.yml
    - .github/ISSUE_TEMPLATE/config.yml
    - .github/ISSUE_TEMPLATE/feature_request.yml
    - .github/PULL_REQUEST_TEMPLATE.md
    - .github/workflows/branch.yml
    - .github/workflows/linting_comment.yml
    - .github/workflows/linting.yml
    - .github/CONTRIBUTING.md
    - .github/.dockstore.yml
    - .github/CONTRIBUTING.md
    - .github/CONTRIBUTING.md
    - assets/sendmail_template.txt
    - LICENSE
    - .prettierignore
    - .prettierignore
    - .prettierignore
    - .github/CONTRIBUTING.md
    - .github/PULL_REQUEST_TEMPLATE.md
    - .github/ISSUE_TEMPLATE/bug_report.yml
    - .github/ISSUE_TEMPLATE/config.yml
    - .github/ISSUE_TEMPLATE/feature_request.yml
    - .github/PULL_REQUEST_TEMPLATE.md
    - .github/workflows/branch.yml
    - .github/workflows/linting_comment.yml
    - .github/workflows/linting.yml
    - .github/CONTRIBUTING.md
    - .github/.dockstore.yml
    - .github/CONTRIBUTING.md
    - .github/CONTRIBUTING.md
    - assets/sendmail_template.txt
    - LICENSE
    - .prettierignore
    - .prettierignore
    - .prettierignore
    - .github/CONTRIBUTING.md
    - .github/PULL_REQUEST_TEMPLATE.md
    - CODE_OF_CONDUCT.md
    - assets/nf-core-nextflow_logo_light.png
    - docs/images/nf-core-nextflow_logo_light.png
    - docs/images/nf-core-nextflow_logo_dark.png
    - .github/ISSUE_TEMPLATE/bug_report.yml
  modules_config: false
  modules_json: false
  multiqc_config: false
  nextflow_config: false
  nfcore_components: false
  readme:
    - nextflow_badge
    - nextflow_badge
    - nextflow_badge
  schema_description: false
  schema_lint: false
  schema_params: false
nf_core_version: 3.0.2
org_path: null
repository_type: pipeline
template:
  author: "@marrip"
  description: this is a mock pipeline
  force: true
  is_nfcore: false
  name: nextflow
  org: nf-core
  outdir: .
  skip_features:
    - github
    - ci
    - igenomes
    - github_badges
    - nf_core_configs
    - code_linters
    - citations
    - gitpod
    - codespaces
    - multiqc
    - fastqc
    - modules
    - changelog
    - nf_schema
    - license
    - email
    - adaptivecard
    - slackreport
    - documentation
    - test_config
    - seqera_platform
  version: 1.0.0dev
update: null

@awgymer
Copy link
Contributor

awgymer commented Oct 30, 2024

I am able to recreate this issue.
Bug is due to an incorrect determination of the template config to use when generating a copy of the pipeline for the lint test.
No workaround available, will have to wait for a fix to be applied.

@marrip
Copy link
Author

marrip commented Oct 30, 2024

thanks for identifying this @awgymer 🙏 Then I will wait for a fix.

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

3 participants