Skip to content

Conversation

@cz4rs
Copy link
Contributor

@cz4rs cz4rs commented Dec 12, 2024

fixes #2378

The new PR checks (clang-format) workflow will NOT fail when the style is not applied, for now this is purely informative.


Misc notes:

// clang-format off
...
// clang-format on

@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from 0ccbc6e to 2d66457 Compare February 21, 2025 09:27
@cz4rs
Copy link
Contributor Author

cz4rs commented Feb 21, 2025

887 files changed looks somewhat scary, but a lot of those changes are pretty innocent - adding missing spaces, adjusting line length etc. I will try to identify the key and potentially controversial changes (for example all serialize methods formatting gets much less readable).

@cz4rs
Copy link
Contributor Author

cz4rs commented Feb 24, 2025

Meeting notes: consider only running clang-format for recent changes (current PR) and adding comments / reporting in CI.

@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 24, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch 15 times, most recently from 80602f8 to 8fa0cf3 Compare February 25, 2025 19:25
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch 5 times, most recently from 32d8f12 to bf7d2ff Compare February 25, 2025 19:39
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from bf7d2ff to 4976a6f Compare February 25, 2025 19:40
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from 288bae9 to 64ee88c Compare February 25, 2025 21:19
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch 2 times, most recently from 6e0de60 to 1a94d34 Compare February 25, 2025 21:29
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from 1a94d34 to 4feb925 Compare February 25, 2025 21:31
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch 3 times, most recently from 126627b to b1ab842 Compare February 25, 2025 21:41
@DARMA-tasking DARMA-tasking deleted a comment from github-actions bot Feb 25, 2025
@github-actions
Copy link

github-actions bot commented Feb 25, 2025

clang-format output for this changeset:

no modified files to format

@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from b1ab842 to b0796c1 Compare February 25, 2025 21:53
@cz4rs cz4rs marked this pull request as ready for review February 25, 2025 21:53
@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from b0796c1 to 25dfdcd Compare February 25, 2025 21:53
run: |
{
echo 'CLANG_FORMAT_DIFF<<EOF'
git clang-format-16 --diff origin/${{ github.base_ref }} || true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git clang-format-16 --diff origin/${{ github.base_ref }} || true is the core of the action, the rest is pretty much boilerplate and comment-posting code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

} >> "$GITHUB_ENV"
- uses: actions/github-script@v7
with:
script: |
Copy link
Contributor Author

@cz4rs cz4rs Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script part boils down to:

  • find the comment id if the comment already exists
  • create or update the comment with clang-format output

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty much the same what DARMA-tasking/comment-on-pr action does, but the script seems short enough to be put directly here.

Copy link
Collaborator

@lifflander lifflander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me.

@cz4rs cz4rs force-pushed the 2378-update-clang-format branch from 25dfdcd to ca3aa8f Compare February 26, 2025 21:45
@lifflander lifflander merged commit 328cda2 into develop Feb 27, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update .clang-format to match style guidelines

3 participants