-
Notifications
You must be signed in to change notification settings - Fork 355
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
cli: implement enough of jj fix
to run a single tool on all files
#3698
Conversation
d8a3327
to
59265e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just minor stuff and a question
Just as a note, I think it would be nice if:
Maybe a map in the config, something like: [fix]
"glob:**/BUILD" = "fix-bazel-files" # this is a command in $PATH
"glob:**/*.rs" = ["rustfmt", "..."] # include more arguments Which would allow a more fine-grained approach. Probably neither of these need to be handled on a first pass, though, and are relatively simple additions. |
Yes, that's coming in a later PR. I don't think @hooper has started working on it, but we're planning to add it, and I think it's trivial to add.
Also planned :) |
btw, non-googlers: don't worry, i'm just helping review this but i'll leave approval for a non-googler |
Also for non-Googlers, a lot of the context is in the documentation for the prior art in Mercurial: https://www.mercurial-scm.org/doc/hg.1.html#fix |
In my opinion, This would fix some issues, which the Mercurial version has. [fix]
# "patch" could mean accept the patch it generates and directly apply it.
clang-format = { bin = "git-clangformat", files = "glob:**/*.h,**/*.cc", patch = true }
rustfmt = { bin = "rustfmt", files = "glob:**/*.rs", args = "..." }
buildifier-lint = { bin = "buildifier", files = "glob:**/*.bzl,BUILD", args = "--lint" }
buildifier-fmt = { bin = "buildifier", files = "glob:**/*.bzl,BUILD" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another round of mostly minor points, it looks good enough to land for me anyway.
ce622cc
to
d22a2ff
Compare
dcab689
to
981555e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if you create the issue and address my doc nits. I'd wait for a final approval from Waleed though, as he definitely is better qualified.
4597b34
to
7fc5ce4
Compare
Our immediate motivation is to have something basic that will work with a code formatter multiplexing wrapper script thingy inside of Google. The goal is to get to feature parity with
hg fix
, minus a couple of bad parts.The main difference to look out for here was mentioned in Martin's PR, which is that for efficiency we want to loop over file IDs instead of (file ID, commit ID) pairs. That comes with some complications to error reporting.
Checklist
If applicable:
CHANGELOG.md