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

clang-format performs SortIncludes even if DisableFormat: true #34447

Closed
vvuk mannequin opened this issue Oct 26, 2017 · 3 comments
Closed

clang-format performs SortIncludes even if DisableFormat: true #34447

vvuk mannequin opened this issue Oct 26, 2017 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@vvuk
Copy link
Mannequin

vvuk mannequin commented Oct 26, 2017

Bugzilla Link 35099
Resolution FIXED
Resolved on May 04, 2021 11:05
Version 5.0
OS Windows NT
CC @NN--
Fixed by commit(s) 61dc0f2

Extended Description

DisableFormat: true doesn't turn off SortIncludes (clang-format 5.0):

$ printf '#include \n#include \n' | clang-format -assume-filename=test.cpp -style='{DisableFormat: true}'
#include
#include

It needs to be explicitly specified as false to turn it off:

$ printf '#include \n#include \n' | clang-format -assume-filename=test.cpp -style='{DisableFormat: true, SortIncludes: false}'
#include
#include

Not sure if it is intentional or not -- was surprising at the very least.

@NN--
Copy link
Mannequin

NN-- mannequin commented Apr 14, 2021

Issue persist clang-format 11.0.

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 30, 2021

Seems confusing to me as well, put in a quick hotfix https://reviews.llvm.org/D101628

@llvmbot
Copy link
Collaborator

llvmbot commented May 4, 2021

Fixed in 61dc0f2

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

1 participant