How do i fix clang-format issues slowing down my C++ pull requests?
#1
I’ve been trying to contribute to a large C++ project by fixing minor bugs, but I keep getting my pull requests rejected because my patches don’t follow the project’s specific clang-format rules. I thought getting the logic right was the hard part, but now I’m spending more time adjusting whitespace and brace placement than writing code. Has anyone else hit a wall with automated code formatting tools slowing down their initial contributions?
Reply
#2
Yep I hit that wall I felt like I was chasing whitespace ghosts I fixed a bug and the patch got rejected again because it changed indentation or line breaks I added a local clang format pass and a pre commit hook and kept the repo clang format rules but even small diffs still trigger a reformat
Reply
#3
Same here I tried to copy a working patch to understand the style but each file had its own nuance the config seemed to drift between modules and I spent more time running format than actually coding and it felt endless.
Reply
#4
Do you think the problem is not the code but the review expectations sometimes reviewers want a patch that is perfect in format and tests and that can stall progress?
Reply
#5
Another angle I tried was to wait until a big batch of changes and then fix formatting across the board but that slowed things down and I dropped the patch when it felt pointless
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: