-
Notifications
You must be signed in to change notification settings - Fork 156
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
Automatic code formatting in PRs #456
Comments
I believe this is essentially blocked on us providing a explicit formatter in the devcontainer and configure it such that formatting is enabled in the repo. Looking at the llvm feature we are currently installing all packages. @trxcllnt would it be feasible to create a "clang-format" feature? What I really want to avoid is that the llvm-16 devcontainer requires different formatting than the llvm-7 devcontainer because it uses different clang-format binaries. Furthermore, if we enable code checking as part of CI we need to also provide a way for users to automagically do this. I do not care the slightest whether we use cmake-format or a pre-commit hook or whatever, but it must be frictionless to use within all our devcontainers |
Yep, that's the first item in #455
Indeed. We'll install the latest version of
That's what the slash command is for 🙂. |
I meant to do it locally and not in CI later |
Local formatting will be done with devcontainers. If people don't want to use devcontainers, then we'll have the slash command. |
Yeah, I can make the LLVM feature only install a subset of the packages. Then we can define it multiple times with different versions and package subsets. I just did this with the CUDA feature so we could layer in cuTensor, cuDNN, etc. So this shouldn't be too difficult. |
We want an easy, automatic system for checking code in a PR is consistent with our
.clang-format
as well as applying the appropriate formatting.An important part of maintaining a consistent formatting is using the identical version of the
clang-format
binary everywhere. We can address this by including a consistent version in all of our devcontainers.However, for the convenience of external contributors, we should also have a way to automatically format the code without requiring them to format it locally. One option would be to have an action that automatically checks if the code is formatted correctly and immediately commits to the PR with the correctly formatted code.
However, this may be surprising to people to have commits automatically added to their PR without manual intervention. As a compromise, we should still add a Action to verify the code is formatted, but instead of automatically applying the formatting, we add a
/format
slash command that will format the code and apply a commit to the PR.Tasks
The text was updated successfully, but these errors were encountered: