[haiku-development] Re: Checker bot for Gerrit

  • From: Owen Pan <owenpiano@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 22 Jun 2021 17:41:01 -0700

Hi,

On Sat, Jun 19, 2021 at 2:20 PM saloni goyal <salonig1212@xxxxxxxxx> wrote:

Hi!

I am working on this bug:

https://review.haiku-os.org/c/haiku/+/3826/1/src/preferences/input/InputKeyboard.cpp#48


As Niels commented, this is not something that clang-format should handle.
The second option suggested by Adrien is the way to go.

and have corrected the indentation of the AddGroup block but I am
stuck at the line where I have to merge a line with the previous one.
I am not able to find out how to do this. My approach for the solving
the AddGroup Indentation is that I run my code after the clang format
have indented all the functions related to AddGroup on the same level
and then applied my code on it and it worked fine but now I am unable
to resolve the issue that how it should merge or break line when it is
exceeding the column limit.
Please help me.

Thanks
Saloni


You have probably learned by now that fixing bugs in clang-format and
customizing it are not easy. It had taken me some time before I could
submit patches to LLVM for review. Even after working for companies with
millions LOC in the most unusual style one can imagine, I still wouldn't
say it's a cakewalk.

I already offered some tips here
<https://discuss.haiku-os.org/t/gsoc-2021-improvements-to-clang-format-and-clang-tidy-to-format-code-according-to-haiku-coding-guidelines-haiku-project/10761/2>.
Here is some additional advice:

   - Fork a released version of clang, not the main trunk which is a moving
   target. You can fork haiku-format
   <https://github.com/owenca/haiku-format> which is based on clang-format
   10.0.1, or clang-format 12.0.0 which requires this patch
   <https://reviews.llvm.org/rG39ecfe614350fa5db7b8f13f81212f8e3831a390> by
   Niels.
   - Try to fix a bug in clang-format and submit your patch to Phabricator
   <http://reviews.llvm.org> for review. You can find known bugs at
   bugs.llvm.org. (If you think #17
   <https://github.com/owenca/haiku-format/issues/17> is a clang-format
   bug, you can submit a bug report there. If you have a code fix for it, you
   should submit it to LLVM for review.) It usually takes a while before any
   reviewer will comment on the patch, but if you add me (owenpan) to the
   reviewer list, I can get on it right away.
   - When you investigate an issue that haiku-format 10.0.1 may have, first
   verify that it's not a bug in clang-format. Then determine whether it's a
   bug in haiku-format or a new area of the Coding Guidelines
   <https://www.haiku-os.org/development/coding-guidelines/> that requires
   additional customization of clang-format. If the latter, make a careful
   evaluation before committing to adding the new feature. #5
   <https://github.com/owenca/haiku-format/issues/5> and Braces Insertion
   <https://reviews.llvm.org/D95168> are just two examples of what areas of
   coding standards that are not suitable for clang-format to deal with.

Regards,
Owen

Other related posts: