Skip to content

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

@vvuk

Description

@vvuk
mannequin
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions