-
Notifications
You must be signed in to change notification settings - Fork 614
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
Apply a formatter for CMake files #5973
Conversation
Should we add gersemi to wpiformat? We already use black for Python formatting (pyformat.py), which has similar cmdline arguments. |
I think that's a good idea. I'll make a PR over there and change this one accordingly. |
Should we generate a default .gersemirc file? What kinds of things does it let us configure? Are we OK with the default formatting @PeterJohnson? |
wpiformat PR is wpilibsuite/styleguide#265. |
A .gersemirc file allows you to configure the same things the CLI allows you to configure. I'm going to add one because that allows us to change the settings without having to change it in wpiformat, which means we don't need to commit to wpiformat to make a formatting change, then commit to allwpilib to format it. |
/format |
We should exclude cmake/toolchains--these files are mostly copied from OpenCV. |
This should make it skip the cmake/toolchains folder: diff --git a/.styleguide b/.styleguide
index 1ba4e1dcc..f67c100e0 100644
--- a/.styleguide
+++ b/.styleguide
@@ -10,6 +10,7 @@ cppSrcFileInclude {
}
modifiableFileExclude {
+ cmake/toolchains/
\.patch$
gradlew
} |
Making this change will make wpiformat run on CMake files (you'll need to merge in main): diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml
index cac0a2f8a..6545600a9 100644
--- a/.github/workflows/lint-format.yml
+++ b/.github/workflows/lint-format.yml
@@ -27,7 +27,7 @@ jobs:
with:
python-version: 3.8
- name: Install wpiformat
- run: pip3 install wpiformat==2023.34
+ run: pip3 install wpiformat==2023.35
- name: Run
run: wpiformat
- name: Check output |
I don't know why, but wpiformat now wipes out all CMake files. |
Tyler just merged wpilibsuite/styleguide#265, so that could be why? |
Well, yeah. I know it's my PR. What I'm trying to figure out is why it's wiping the files. |
The task config in wpiformat 2023.35 was bad. Upgrade to 2023.36. |
/format |
Formats all CMakeLists with gersemi.