-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Req: apply the check selectively on just the changed files #83
Comments
A couple of approaches I can think of:
Otherwise, if your request is to run If I were in your shoes I'd still bite the bullet and just run it repo-wide, git history pollution be damned (that way all the formatting changes are isolated to a single commit). Then, if I need to use |
Unfortunately, in this codebase, very few files are fully
Well, here is a tool that people use in their pre-commit hooks: https://github.com/llvm/llvm-project/blob/main/clang/tools/clang-format/clang-format-diff.py I run it in my local repo via another helper script... but it comes down to this:
I thought the Action may be able to do something similar. Basically we'd have to get a diff to the top of the destination branch, filter the source files and then check the resulting delta. |
I've just tried running the action and it simply scans files in the predefined directories. So, here are two feature requests:
|
I would also find this useful. |
Implementation caveat: need to be careful about differences in Possible solution: build a separate set of Docker images in the GHCR for this repo and base them on Ubuntu Python images for 2 or 3, depending on the major version of |
clang-format-${CLANG_FORMAT_VERSION} package should provide already /usr/bin/clang-format-diff- ${CLANG_FORMAT_VERSION} |
Neat, and it's available for all versions this action supports! https://packages.ubuntu.com/bionic/amd64/clang-format-3.9/filelist |
Possible solution for jidicula#83
@jidicula what about linuxmaniac@91849f4 as a base for getting this done? Can you please take a look? |
@linuxmaniac +1 for the feature. |
+1. This feature would cut our pipeline down significantly. |
Possible solution for jidicula#83
@moran-inadvantage How about PRing your branch? |
PRs are definitely welcome - sorry that I haven't had much time to look into this lately. @linuxmaniac or @moran-inadvantage if you want to PR your changes into this repo, go ahead and I'll approve the CI runs on it to see how these solutions work against the test matrix. |
Context: a sizeable code base into which I had added
clang-format
. People use it... but only a subset of source lines is up to the spec. Obviously, I can runclang-format
on all files... but that will pollute Git history.Ask: apply
clang-format
just to the delta that is being merged.Justification: this way the large code base will slowly and inevitably converge.
The text was updated successfully, but these errors were encountered: