Skip to content

Add clang-format bot command for pull requests#2032

Merged
ZedThree merged 1 commit intomasterfrom
add-clang-format-bot
May 21, 2020
Merged

Add clang-format bot command for pull requests#2032
ZedThree merged 1 commit intomasterfrom
add-clang-format-bot

Conversation

@ZedThree
Copy link
Member

Simply have "/clang-format" as the first line in a comment to have clang-format automatically run over your PR! Commits are by github-actions[bot]. It uses git-clang-format to just format the changes in the PR.

I've tested this fairly extensively in a private repo, so I'm hoping it just works here. It needs to be merged into master and then it should Just Work. And it only took me this afternoon!

Simply have "/clang-format" as the first line in a comment to have
clang-format automatically run over your PR!
Copy link
Contributor

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@ZedThree ZedThree merged commit 2112734 into master May 21, 2020
@ZedThree ZedThree deleted the add-clang-format-bot branch May 21, 2020 16:10
git clang-format-9 ${{ github.event.client_payload.pull_request.base.sha }}
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -am "[clang-format-command] fixes"
Copy link
Contributor

Choose a reason for hiding this comment

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

I just learned that there is the option --ignore-rev [1]

It might be worth to add it here 👍

[1] https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame

Copy link
Member Author

Choose a reason for hiding this comment

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

As in, add the commit to a .git-blame-ignore-revs file? I guess that's possible, although it would require two commits. Another possibility would be to just periodically dump commits from github-actions[bot] to that file.

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.

3 participants