nf-core / modules

Repository to host tool-specific module files for the Nextflow DSL2 community!
https://nf-co.re/modules
MIT License
282 stars 717 forks source link

Add Editor Config lint back in #77

Closed drpatelh closed 3 years ago

drpatelh commented 4 years ago

I commented out the Editor config linting https://github.com/nf-core/modules/pull/76/commits/082c582258fc16c2afc32f94af157ac8faaf12cc but it would be good to fix and add this back in. Possibly in one go to get all of the tests passing again.

edmundmiller commented 3 years ago

The comments are breaking this

/*
 * Tidy up and join elements of a list to return a path string
 */

After running eclint fix on everything it still throws errors about invalid indent size: 1, expected: 0 on the block comments.

grst commented 3 years ago

Maybe this helps: https://github.com/jedmao/eclint#support-for-doc-comments

edmundmiller commented 3 years ago

@grst Good catch!

Per https://github.com/jedmao/eclint/issues/226, eclint is no longer maintained.

https://github.com/editorconfig-checker/editorconfig-checker.javascript#readme is however, and it works with the comment blocks out of the box. PR incoming.

Something cool might be making a prettier plugin hooked up to the nf-core lint

grst commented 3 years ago

I think prettier supports editorconfig out-of-the-box:

If options.editorconfig is true and an .editorconfig file https://editorconfig.org/ is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by .prettierrc, etc. Currently, the following EditorConfig properties are supported

https://prettier.io/docs/en/api.html#prettierresolveconfigfilepath--options

EDIT: there might be more to nf-core lint that prettier should respect. In that case a plugin would be nice, of course!

On Tue, 17 Nov 2020 at 16:43, Edmund Miller notifications@github.com wrote:

@grst https://github.com/grst Good catch!

Per jedmao/eclint#226 https://github.com/jedmao/eclint/issues/226, eclint is no longer maintained.

https://github.com/editorconfig-checker/editorconfig-checker.javascript#readme is however, and it works with the comment blocks out of the box. PR incoming.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nf-core/modules/issues/77#issuecomment-729014496, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVZRV2ITSYKGAPD7UOBXX3SQKKZBANCNFSM4TTNQBJA .

drpatelh commented 3 years ago

Thanks guys! Those comments can be changed to support default options in editor linting tools by the way. Don't really use these normally so opinion neutral as to which one we go for. Ideally, something that has longevity.

edmundmiller commented 3 years ago

@grst I definitely prefer prettier myself. I was just getting at using it for all the linting would be cool (md, and yaml) and having a nextflow plugin! I was also hoping to avoid adding a .prettierrc to the project though, because I don't think the conversation has been had to possibly move yaml or md over. I don't think we should bother with it unless a nextflow-plugin is created. I'll look into it in a few weeks.

As I thought I can't find a way to just run editorconfig on files that don't have a parser with prettier.