Skip to content

Conversation

@antkmsft
Copy link
Member

@antkmsft antkmsft commented Jul 1, 2024

Closes #5666.

Aren't you tired when, for whatever reason, your local clang-format does format files a bit differently than it gets formatted in the CI, so CI fails on you, and you have to find creative ways to guess what that format might be, and, for example, spin up an Ubuntu machine, and run clang-format there? I am not saying we should not eventually find the root cause and eliminate possibilities for formatting discrepancies, if possible; but until then this fix will save you time.
I have tested this fix in the CodeGen repo (log: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3924247&view=logs&j=b5cdfb1e-c180-561f-918e-a169e451719e&t=a95f8d37-03f1-5b78-3f33-b1433acf4822), and when clang-format starts giving me troubles in the CI, I now I can have a follow-up commit with the right formatting basically within seconds. All I do, is I copy the part of the log file between ---s, put it in c:\src\patch.txt (not forgetting to put empty line at the end of patch.txt), then I go to c:\src\azure-sdk-for-cpp, run git apply --ignore-space-change ..\patch.txt, add files to commit, review changes, and push them to my PR.

@antkmsft antkmsft added the EngSys This issue is impacting the engineering system. label Jul 1, 2024
@antkmsft antkmsft self-assigned this Jul 1, 2024
@antkmsft antkmsft enabled auto-merge (squash) July 1, 2024 23:52
@gearama gearama disabled auto-merge July 2, 2024 00:10
@antkmsft antkmsft merged commit f8130a2 into Azure:main Jul 2, 2024
@antkmsft antkmsft deleted the fmt-err-diff branch July 2, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When clang-format fails in CI, it could print the diff

3 participants