Skip to content

Conversation

@ewels
Copy link
Member

@ewels ewels commented Mar 23, 2025

Nicer output from the new nextflow format and nextflow lint commands. @bentsherman you will probably want to clean up my crappy Groovy code, but I'm happy with the outputs now.

TODO:

  • Replicate the .gitignore exclusions to format
  • Refactor code to avoid duplication
  • @bentsherman to clean up my crappy groovy code
  • [Maybe]: Improve .gitignore code to work when launching from anywhere in the project tree

Format

CleanShot.2025-03-27.at.13.30.53.mp4

Lint

CleanShot.2025-03-27.at.13.28.29.mp4

@ewels ewels requested a review from bentsherman March 27, 2025 11:59
@ewels ewels marked this pull request as ready for review March 27, 2025 11:59
@ewels ewels force-pushed the lint-format-ansi-log branch from c288ae7 to c2c071e Compare March 27, 2025 12:00
ewels added 7 commits March 27, 2025 13:01
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
@ewels ewels force-pushed the lint-format-ansi-log branch from c2c071e to 417ef78 Compare March 27, 2025 12:01
ewels added 2 commits March 27, 2025 13:28
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
@ewels ewels force-pushed the lint-format-ansi-log branch from d8d42e3 to 008a48d Compare March 28, 2025 08:44
ewels added 3 commits March 28, 2025 09:45
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
@ewels ewels force-pushed the lint-format-ansi-log branch from 008a48d to a019566 Compare March 28, 2025 08:45
@ewels
Copy link
Member Author

ewels commented Mar 28, 2025

Added some more functionality:

  • Ability to output the lint results in different formats (full, concise, summary, json)
  • Lint now throws an exception (and so exits with a non-zero error code) if any errors were found
  • Ability to -exclude one or more files / dirs / glob patterns
  • Parsing and use of a .gitignore file if present

The .gitignore stuff is only in lint for now - it should be in both but I don't want to just copy it over, as there is more and more duplication between the two CLI files now. But I'm not really sure where I should put this shared code?

@ewels ewels requested a review from Copilot March 28, 2025 12:03

This comment was marked as resolved.

@ewels
Copy link
Member Author

ewels commented Apr 1, 2025

Wonder if we can set up GitHub actions to use the JSON output to spit out error messages for inline PR notes about lint errors 👀

I read somewhere that it's only possible to do 10 at a time from GitHub Actions (GitHub apps more), many links seem outdated, so may need a bit of testing to see how viable it is.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman requested a review from a team as a code owner April 1, 2025 19:07
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman
Copy link
Member

  • Remove .gitignore logic for now until we decide on an overall strategy (see Repo config file for lint / format #5934)
  • Use "error listener" interface to separate output formats from core linting logic
  • Re-use the ANSI error listener in the script loader
  • Move file exclusion checker into nf-lang (it will be re-used by the language server)

@bentsherman bentsherman merged commit 338fad5 into nextflow-io:lint-format-commands Apr 1, 2025
3 of 5 checks passed
@ewels ewels deleted the lint-format-ansi-log branch April 3, 2025 14:55
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

Successfully merging this pull request may close these issues.

2 participants