Skip to content
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

Update .clang-format import groups order #1254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tweksteen
Copy link
Member

Match the import order to the style guide[1]. This is based on art/.clang-format.

[1] https://source.android.com/docs/setup/contribute/code-style#order-import-statements

Test: repo upload .
Change-Id: Ifd5c45fce2e20adf818d1cf03637f07b10786122

Match the import order to the style guide[1]. This is based on
art/.clang-format.

[1] https://source.android.com/docs/setup/contribute/code-style#order-import-statements

Test: repo upload .
Change-Id: Ifd5c45fce2e20adf818d1cf03637f07b10786122
@tweksteen
Copy link
Member Author

We might want to add a step to Gradle to run clang-format as part of CI (I don't think this is done yet, but I might be wrong). One option is to use Spotless with clangFormat(). Let me know if that something you'd consider and I can create a bug to track that. Thanks.

@prbprbprb
Copy link
Collaborator

The problem is that all the old code is formatted to the wrong standard, so if we auto-run clang-format then every time we touch a file, it'll get reformatted and break the git blame history.

@tweksteen
Copy link
Member Author

Spotless has a configuration option ("ratchet") exactly for that purpose: https://github.com/diffplug/spotless/blob/main/plugin-gradle/README.md#how-can-i-enforce-formatting-gradually-aka-ratchet

It will only report a formatting issue on the diff (and nothing else).

@prbprbprb
Copy link
Collaborator

Ah, that sounds promising then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants