-
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
clang-format spec #202
Comments
I think this would be awesome, but I don't think Clang will be able to parse all our source files at the moment--see #109. |
It doesn't matter. Clang-format doesn't need to understand the sources to format them. |
Cool, I didn't realize it was flexible enough to handle C++/CX syntax, but you're right--it appears to work. cc: @danbelcher-MSFT |
This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it. |
Doing it in this PR #236 I tried to craft the closest code style to an existing code base with its rules. |
As part of this, we need to figure out a good solution for having this run within our Azure DevOps pipeline so that our builds can catch and prevent regressions, otherwise this will be a never-ending battle. |
Clang comes with tools for for integration. You can use them to format the patch (no need to run on full report) and have it report back the changes required or conformance, https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/git-clang-format |
@janisozaur / @seyfer / general community - Is there someone that can sign-up to get clang-format to run with the build automatically? I can see different final outcomes:
Are there any other suggestions on how this should be handled? In short, I want this change, but I also want it to be self-sustaining long-term, so it would be great to have it hooked-up to be automated as part of this change. Thanks. |
@HowardWolosky thank you for the descriptive answer. I just resolved conflicts in the PR. |
Since #236 is locked: https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.ClangFormat There are completely static builds of |
Since PR is locked, answering here |
This is not necessary, Visual Studio already includes |
@danbelcher-MSFT answering here to review comment
this is not really possible to keep the previous style at all. This setting controls at which point all cases will be broken or kept in one line The goal of this PR to have standardized code style. Here personally I do not care much about how, but only about establishing some standard for all developers. |
@danbelcher-MSFT if I set
is it better? |
Hey all, it seems like there is community interest in getting this change checked-in. I unlocked the PR so we can discuss details there. |
Fixes #202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
Fixes microsoft#202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
Is there a chance to have a
.clang-format
file added to the repository so that code can be automatically formatted?The text was updated successfully, but these errors were encountered: