Skip to content

Order include directives alphabetically. #42

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

Open
syml opened this issue Jul 6, 2015 · 3 comments
Open

Order include directives alphabetically. #42

syml opened this issue Jul 6, 2015 · 3 comments

Comments

@syml
Copy link

syml commented Jul 6, 2015

The google C++ style guide recommends to sort include directives alphabetically. https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Names_and_Order_of_Includes

It would be nice if codefmt's FormatCode could also do this.

@dbarnett
Copy link
Contributor

dbarnett commented Jul 6, 2015

Having two partial formatters for C++ might mean people would want #44 so you could run this include sorting and clang-format on the same source code.

@fowles
Copy link
Contributor

fowles commented Jul 14, 2015

Discussion with clang-format owners indicate they may be willing to implement this in clang format.

@dbarnett
Copy link
Contributor

Looks like clang has a sortIncludes option now. Does it sort includes how you want it automatically now, or would we need to explicitly configure something to enable it?

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

No branches or pull requests

3 participants