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

feature: add a --check option to sprocket format #29

Open
peterhuene opened this issue Oct 17, 2024 · 3 comments
Open

feature: add a --check option to sprocket format #29

peterhuene opened this issue Oct 17, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@peterhuene
Copy link
Collaborator

peterhuene commented Oct 17, 2024

This option would be useful in CI where it would:

  • Format a WDL document or directory containing WDL documents
  • Instead of overwriting the files, it would diff the format output with the original output and treat any difference as an error; it should print out a nice git-like diff of the changes (the pretty-assertions crate has a very nice implementation of this).
  • It should exit with a non-zero status if any file had a diff.
@peterhuene peterhuene added enhancement New feature or request good first issue Good for newcomers labels Oct 17, 2024
@a-frantz
Copy link
Member

How much of the logic for --check should be in this repo? I think that if the answer is "all of it", this is going to be the first case of "business logic" living in the sprocket repo. Not exactly a problem, but something that should be done intentionally.

I wonder if this would make more sense to live in one of the wdl- crates (though which one isn't obvious to me).

@peterhuene
Copy link
Collaborator Author

I think it'd be fine to expose the "check" functionality from wdl-format.

@a-frantz
Copy link
Member

I've flipflopped. The "check" functionality isn't really anything other than input == formatted. I think it's fine to house that logic within sprocket just to keep things simple. Consider my comment revoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants