[clang] Allow SortIncludes to override DisableFormat when both are explicitly set to true (PR #208916)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 01:48:57 PDT 2026


================
@@ -1355,6 +1355,8 @@ template <> struct MappingTraits<FormatStyle> {
     IO.mapOptional("Cpp11BracedListStyle", Style.Cpp11BracedListStyle);
     IO.mapOptional("DerivePointerAlignment", Style.DerivePointerAlignment);
     IO.mapOptional("DisableFormat", Style.DisableFormat);
+    if (Style.DisableFormat)
----------------
mydeveloperday wrote:

This feels messy, if the purpose of this change to be allowed to use clang-format to ONLY sort includes but no other formatting, then why not change DisableFormat from a boolean to an enumeration and support  Enabled, Disabled, SortIncludeOnly, + fallback true, false as options? would that solve what you are trying to do?

https://github.com/llvm/llvm-project/pull/208916


More information about the cfe-commits mailing list