GSoC 2021 Progress Update 3: Coding style checker bot for Gerrit | Haiku Project

Tl;dr I have completed the bot with basic functionality for my local gerrit instance

Link to Introductory blog Link to Progress 1 Link to Progress 2

This is a companion discussion topic for the original entry at

Thanks for working on this – it will be very helpful.

1 Like

Glad to be working on this! :slightly_smiling_face:

1 Like

Here are the screenshots for the scenarios described in the post.

Adding files

Formatted files

1 Like


it would also print terminal color codes […] After looking for various ways to remove it I settled with using git config color.diff false

I don’t know if this was among the considered ways, but you can set that directly in the git diff command, with the --no-color option.

posting the comments on Gerrit

Beware that comments have an approximate 16KB limit (configurable). Can be an issue when there is a considerable amount of violations. The result would be an HTTP error (I think 400, but don’t quote me on that) and the whole request unserved (that is, not just the message, but also the label).

1 Like

I am using the git clang-format command which internally calls git diff. git clang-format does not support passing --no-color.

Got it! After discussing on the mailing list the current idea is to post the results on patchset comments only if it’s under a certain limit but host the results somewhere else and provide the link in the patchset comments if it’s above that limit.

1 Like