-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perform clang-format on Azure #405
Conversation
There are tools like |
I would suggest to use the |
Can we set this up as a git hook so that source is automatically formatted? We want our tools to work with us and help us take contributions faster. |
Setting up a git hook is a client-side action. |
I see. I haven't looked into this topic and I'm new to OSS development, so this isn't an area I'm very familiar with. If this is typical process for other projects then we should follow convention. |
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
|
@janisozaur great. I will fix conflicts and review in my PR tomorrow and hope it will be merged together soon. |
buildId=8372, as per #406
This is a C++ CX attribute. It is not strictly needed in this case as the generated .winmd file is not exposed to javascript client code (the case where this attribute means something) so it could be removed. I'm surprised the other CX language elements |
Can it be done with a regular C++ attribute? |
Unfortunatly no. CX was invented to enable features like this that are non-standard. I recommend removing it and verifying everything works (it should). |
This PR has been assigned to me for almost a year, and sadly I haven't had time to dig into this and figure out the right thing to do. I'm closing this PR (and the related #406) because unfortunately I don't think that's going to change anytime soon. I'm sorry it's taken so long to come to a decision. Having lived with .clang-format settings in the repo for a while now, the impact on development has been mixed. For the C++/CX code--which unfortunately is a lot of the code in the repo, including the code which changes most frequently--the auto-formatted results can be pretty ugly. So I think we can reconsider this change only if we reduce the amount of C++/CX code we have. |
Fixes (part of) #202.
#236 discusses the contents of
.clang-format
, this PR makes CI capable of enforcing it.A problem I ran into was
clang-format
mistaking some of the sources for Objective-C, due to non-C++ constructs like https://github.com/Microsoft/calculator/blob/f6a6aae6e6ce1c485b4b4b02413259649cf2b58f/src/Calculator/Converters/BitFlipAutomationNameConverter.h#L13I have no idea what that is, so I took the easy way out and only apply formatting files which name ends with
.cpp
.I provided comments in the script itself, but the gist of it is:
clang-format
from https://github.com/angular/clang-format/blob/master/bin/linux_x64/clang-format, a long standing repo with occasional updates to the toolclang-format
on the sources (files ending with.cpp
)You can see a failing build here: https://dev.azure.com/ms/calculator/_build/results?buildId=8367
And a passing one (with sources formatted) here: https://dev.azure.com/ms/calculator/_build/results?buildId=8372, as per #406
This PR does not include
.clang-format
, I hope @seyfer will update #236 and it will get merged.