Skip to content

Repo config file for lint / format #5934

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

Open
ewels opened this issue Apr 1, 2025 · 9 comments
Open

Repo config file for lint / format #5934

ewels opened this issue Apr 1, 2025 · 9 comments

Comments

@ewels
Copy link
Member

ewels commented Apr 1, 2025

Putting down some ideas for a potential new config file to be used by the new Nextflow lint and format commands.

Starting position:

  • Can't use nextflow.config as separation of concerns, also potentially a bit recursive
  • Want to make as generic as possible so it can be future-proofed (eg. not .nextflowignore to ignore files only, adaptable for more functionality)
  • Common file format for easy interoperability

To make it clear what this is for, I'd suggest calling this thing nextflowrc, following the *nix convention with rc files for startup config / actions. It could be a hidden .nextflowrc.* dotfile or not, I could go either way.

With this, my initial stab is either YAML or TOML. Here's a very rough first draft with some suggestions for things that we may want to configure

nextflowrc.yml

lint:
   exclude:
      - "testing/*"
      - "docs/**/*.nf"
   output-format: concise
format:
   exclude:
      - modules
   spaces: 4
   harshil-alignment: true

Or toml, as used by pyproject.toml and netlify.toml etc:

nextflowrc.toml

[lint]
exclude = ["myworkdir/*", "snippets/**/*.nf"]
output-format = "extended"

[format]
exclude = ["modules"]
tabs = true
harshil-alignment = false

Note that we could support multiple formats, though I'm not sure that this would add much.

To avoid the proliferation of root-level config files, it may be possible for @nf-core to consider adopting this new file to replace .nf-core.yml (probably optionally), in an nf-core section in the file.

Thoughts + feedback welcome!

@ewels
Copy link
Member Author

ewels commented Apr 1, 2025

Follow-on thoughts:

  • We should load .editorconfig if present and use those values for config around indentation etc. These presets should have lower priority than any Nextflow config file. Example, website
  • We should merge tower.yml into this file, for example under a seqera section.

@ewels
Copy link
Member Author

ewels commented Apr 1, 2025

Similar to .editorconfig, could also read .prettierrc.yml to pick up tabwidth and various other options, eg. here

@maxulysse
Copy link
Contributor

Both format looks human readable, so I'm happy.
And having such a single file is a good idea, especially if we can have a nf-core section and a seqera one

@mahesh-panchal
Copy link
Contributor

Agreed. Leaning towards toml, but would be happy with either.

@jfy133
Copy link
Contributor

jfy133 commented Apr 9, 2025

I'm pro toml

@JoseEspinosa
Copy link
Contributor

I'd say that yaml is more widely adopted, but if it doesn't need to interact with other tools toml seems to be simpler and we will avoid indentation issues 👅

@fasterius
Copy link

I'm very much in favour of toml, and I've seem its adoption increase in recent times, even for tools that previously used yaml.

@pditommaso
Copy link
Member

Could .editorconfig be enough?

@ewels
Copy link
Member Author

ewels commented Apr 9, 2025

Could .editorconfig be enough?

I wondered the same, I had a brief look into it but I don't think that it can be extended unfortunately. Not without it becoming invalid for editorconfig. If anyone else thinks otherwise I'd be happy to be shown that I'm wrong though! 😅 I really dislike dotfile / config files polluting repository root dirs 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants