command/fmt: support formatting multiple files#28191
Conversation
Codecov Report
|
|
codecov is complaining because the added doc is untested :) |
|
ping? |
|
Some more context and justification for this PR from my perspective: treefmt allows dramatically speeding up repository formatting by only attempting to format files that have changed. The current interface to |
a648ade to
0f331a6
Compare
|
rebased to fix the merge conflict |
0f331a6 to
559137f
Compare
|
rebased to fix the merge conflicts |
|
Ping @jbardin. It'd be really nice if this could go in! |
|
/cc @teamterraform |
b070abd to
905b2c0
Compare
|
This feature is useful to have! |
|
Some more justification for this PR: Currently the only way to run terraform via Unfortunately, the startup speed of Whereas This makes treefmt + terraform just about acceptable for local use cases (hopefully the files don't change much, and treefmt only runs on changed files), but it's a deal-breaker for use cases such as checking formatting in CI. |
|
Hi @zimbatm, apologies for the late reply. We should be able to review this within a few weeks. Thanks for your patience. |
alisdair
left a comment
There was a problem hiding this comment.
Thanks for this contribution! This looks like a nice improvement. There are a couple of things to fix before we can merge:
- There's a merge conflict due to some recent help text changes. Can you rebase and fix that?
- We need to update the website docs to note the new functionality. Can you update the docs file here to describe how
terraform fmtworks after your changes?
905b2c0 to
492a8be
Compare
Codecov Report
|
All the code infrastructure was there to support formatting multiple files already. This makes `terraform fmt` more flexible and also compliant with the [treefmt formatter spec](https://numtide.github.io/treefmt/docs/formatters-spec.html)
492a8be to
7a9ccc0
Compare
|
rebased!
|
|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
All the code infrastructure was there to support formatting multiple
files already.
This makes
terraform fmtmore flexible and also compliant with thetreefmt formatted spec
Fixes numtide/treefmt#97