Conversation
| @@ -1,3 +1,3 @@ | |||
| process { | |||
| cpus = 1 // Needed for deterministic results | |||
There was a problem hiding this comment.
Would be good to retain comments if possible.
There was a problem hiding this comment.
I think this is a current limitation in the formatter, it can't handle inline comments like this yet.
There was a problem hiding this comment.
I recommend keeping the formatter off by default. It's not worth losing comments like this one
There was a problem hiding this comment.
That's the point of pre-commit though 😞
|
Looking good, but definitively this is WAY too many files modified at once. |
.pre-commit-config.yaml
Outdated
| entry: nextflow lint | ||
| language: system | ||
| files: '\.nf$|nextflow\.config$' | ||
| args: ["-format", "-sort-declarations", "-spaces", "4", "-harshil-alignment", "-output", "concise"] |
There was a problem hiding this comment.
I'd much prefer a config file 😬 nextflow-io/nextflow#5934
Though I guess we can always add that later.
There was a problem hiding this comment.
I would as well, but perfect is the enemy of good 😉
|
I agree with Maxime. I would turn off the formatting and only fix linter errors in this PR. In a separate PR I would run the formatter as a once-off and undo any comment removals or controversial formatting changes. We should improve the formatter to handle those cases, not the other way around |
Yeah it's a bit much. I'll chat with @nf-core/maintainers about it. I'm thinking we
|
|
Works for me 👍🏻 I think a slow roll-out at first until we're confident is a good idea. We can check each module one by one as they are updated to make sure that the changes are sanitised. This will fail if the locally installed Nextflow version isn't recent enough, right? Any way that we can deal with that gracefully? |
How complicated do you want to get?
- repo: local
hooks:
- id: changelogs-rst
name: changelogs must be rst
entry: changelog filenames must end in .rst
language: fail
files: 'changelog/.*(?<!\.rst)$'
|
As little as possible 😅 |
|
@adamrtalbot played with this too in https://github.com/adamrtalbot/nf-lint-pre-commit |
|
Ran it manually for some modules: #8891 |
|
Hi, |
|
@bentsherman, @ewels , do you have any progress on improving the formatter? |
|
@nf-core-bot fix linting pretty please 🙏 |
|
we need to add setup-nextflow to the linting.yml and fix-litning.yml for this step to work |
No updates yet - we know it's a high priority issue and will get to it ASAP, I think it's currently scheduled to be done once the new Records stuff is in place. Hopefully done before the 26.04 release, but might be another month or so until we get to it. Issues being tracked here, if anything is missing please add more issues. |
|
I think that we could move any comments that are going to be affected and apply the auto formatting anyway. |
Updated this here: https://github.com/seqeralabs/nf-lint-pre-commit/releases/tag/v0.2.0 |
|
Can we also set vscode to do the same on save? |
this is just the linter without the formatter atm |
# Conflicts: # .pre-commit-config.yaml
This reverts commit 774490e.
This will just cause pre-commit to just throw an error but not reformat the code. Users will have to manually format for now. nextflow-io/nextflow#6365 Co-authored-by: maxulysse <maxulysse@users.noreply.github.com>
I would suggest only doing that if vscode is not in auto-save mode |
|
My plan for this PR is waiting for @LouisLeNezet to be done with his heroic linting fix efforts and then merge just the |
| rev: v0.2.0 | ||
| hooks: | ||
| - id: nextflow-lint | ||
| files: '\.nf$|nextflow\.config$' |
There was a problem hiding this comment.
This is the almost the same as the default for the pre-commit hook: https://github.com/seqeralabs/nf-lint-pre-commit/blob/58b2431ebcdf99a0c024c9c7f695bfa30c01555c/.pre-commit-hooks.yaml#L6
Shall we add *.nextflow files upstream? I've never seen one in the wild!
|
Closing in favor of #10241 |
Pull request was closed
This pull request adds a new linting hook for Nextflow scripts to the pre-commit configuration. This will help ensure consistent formatting and style for the repository's
.nfandnextflow.configfiles.