[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Björn Schäpers via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Daan De Meyer via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 607b938f548fcb734893e4082ce135e986353759 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 0827e9c4152485a280dc9e65ca8a0eaa3a9a385f Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Björn Schäpers via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Björn Schäpers via cfe-commits
@@ -4382,8 +4382,18 @@ struct FormatStyle { ///#include "B/a.h" #include "a/b.h" /// \endcode bool IgnoreCase; +/// When sorting includes in each block, Only take file extensions into HazardyKnusperkeks wrote: ```suggestion //

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Owen Pan via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-06-26 Thread Owen Pan via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-27 Thread Daan De Meyer via cfe-commits
DaanDeMeyer wrote: Ping? Would love to get this over the finish line https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-22 Thread Daan De Meyer via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-22 Thread via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-20 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 3cf3ada4cfe78d943815e59f8df9ea74212e76e3 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-20 Thread Björn Schäpers via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 6a3e7f091fbb8bc7117f5ef1d2803e73b8c6f061 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From bb5eb380a0f71cac0c734443b4fbfa4441f441b2 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread via cfe-commits
https://github.com/mydeveloperday edited https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread via cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; LLVMStyle.ShortNamespaceLines = 1; LLVMStyle.SkipMacroDefinitionBody = false; - LLVMStyle.SortIncludes = {/*Enabled=*/true,

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. Do we have the correct current default https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From beab0ecdeda1454de56cf1851dc03dda6d02673e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 33f84b217caab01a5ebbf93e4e5ac2182810c8db Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
@@ -152,6 +152,10 @@ struct IncludeStyle { /// \version 10 std::string IncludeIsMainSourceRegex; + /// When sorting includes in each block, ignore file extensions. DaanDeMeyer wrote: I added more explanation and added an example https://github.com/llvm/

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
DaanDeMeyer wrote: @owenca @HazardyKnusperkeks Rebased onto latest main to take advantage of @owenca's rework and addressed comments. https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From ab2206d22a9d71df807753f193f4110b191ab77b Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IgnoreExtension option to SortIncludesOpt

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Björn Schäpers via cfe-commits
@@ -152,6 +152,10 @@ struct IncludeStyle { /// \version 10 std::string IncludeIsMainSourceRegex; + /// When sorting includes in each block, ignore file extensions. HazardyKnusperkeks wrote: I currently don't have a better name, but this isn't correct. Yo

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-19 Thread Björn Schäpers via cfe-commits
@@ -5368,6 +5368,8 @@ struct FormatStyle { IncludeStyle.IncludeIsMainSourceRegex == R.IncludeStyle.IncludeIsMainSourceRegex && IncludeStyle.MainIncludeChar == R.IncludeStyle.MainIncludeChar && + IncludeStyle.IncludeSortIgnoreExtens

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-15 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-15 Thread Daan De Meyer via cfe-commits
DaanDeMeyer wrote: @owenca Thanks for the detailed review. Changed the name to IncludeSortIgnoreExtension, let me know if you have a better idea for the name. https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@li

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -3221,15 +3223,33 @@ static void sortCppIncludes(const FormatStyle &Style, stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) { const auto LHSFilenameLower = Includes[LHSI].Filename.lower(); const auto RHSFilenameLower = Includes[RHSI].Filename.lower(); -

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -3221,15 +3223,33 @@ static void sortCppIncludes(const FormatStyle &Style, stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) { const auto LHSFilenameLower = Includes[LHSI].Filename.lower(); const auto RHSFilenameLower = Includes[RHSI].Filename.lower(); -

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -3221,15 +3223,33 @@ static void sortCppIncludes(const FormatStyle &Style, stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) { const auto LHSFilenameLower = Includes[LHSI].Filename.lower(); const auto RHSFilenameLower = Includes[RHSI].Filename.lower(); -

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -4226,6 +4226,19 @@ the configuration (without a prefix: ``Auto``). ``ClassImpl.hpp`` would not have the main include file put on top before any other include. +.. _IncludeSortKey: + +**IncludeSortKey** (``IncludeSortKeyDiscriminator``) :versionbadge:`clang-format 20`

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-13 Thread Daan De Meyer via cfe-commits
DaanDeMeyer wrote: > I would expect that file extensions be sorted regardless. For example: > > ``` > #include "a.h" > #include "a.inc" > #include "a-util.def" > #include "a-util.h" > ``` Addressed https://github.com/llvm/llvm-project/pull/137840 ___

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-13 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-13 Thread Owen Pan via cfe-commits
owenca wrote: I would expect that file extensions be sorted regardless. For example: ``` #include "a.h" #include "a.inc" #include "a-util.def" #include "a-util.h" ``` https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-com

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-12 Thread Daan De Meyer via cfe-commits
DaanDeMeyer wrote: Ping @owenca @HazardyKnusperkeks https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-02 Thread Daan De Meyer via cfe-commits
@@ -4226,6 +4226,19 @@ the configuration (without a prefix: ``Auto``). ``ClassImpl.hpp`` would not have the main include file put on top before any other include. +.. _IncludeSortKey: + +**IncludeSortKey** (``IncludeSortKeyDiscriminator``) :versionbadge:`clang-format 20`

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-02 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 7e2463f6fb9a3d64b1be25f2ea6ea91de2d4e982 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IncludeSortKey option Sorting by stem giv

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Björn Schäpers via cfe-commits
@@ -166,6 +166,16 @@ struct IncludeStyle { /// directives that use the specified character are considered. /// \version 19 MainIncludeCharDiscriminator MainIncludeChar; + + enum IncludeSortKeyDiscriminator : int8_t { +/// Includes are sorted alphabetically by their f

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Björn Schäpers via cfe-commits
@@ -4226,6 +4226,19 @@ the configuration (without a prefix: ``Auto``). ``ClassImpl.hpp`` would not have the main include file put on top before any other include. +.. _IncludeSortKey: + +**IncludeSortKey** (``IncludeSortKeyDiscriminator``) :versionbadge:`clang-format 20`

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Björn Schäpers via cfe-commits
@@ -4226,6 +4226,19 @@ the configuration (without a prefix: ``Auto``). ``ClassImpl.hpp`` would not have the main include file put on top before any other include. +.. _IncludeSortKey: HazardyKnusperkeks wrote: Did you write this on your own? You need to d

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Björn Schäpers via cfe-commits
@@ -166,6 +166,16 @@ struct IncludeStyle { /// directives that use the specified character are considered. /// \version 19 MainIncludeCharDiscriminator MainIncludeChar; + + enum IncludeSortKeyDiscriminator : int8_t { HazardyKnusperkeks wrote: Can you so

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Björn Schäpers via cfe-commits
@@ -4226,6 +4226,19 @@ the configuration (without a prefix: ``Auto``). ``ClassImpl.hpp`` would not have the main include file put on top before any other include. +.. _IncludeSortKey: + +**IncludeSortKey** (``IncludeSortKeyDiscriminator``) :versionbadge:`clang-format 20`

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137840 >From 73a18a033e0d978d1662a391fedf731dbad7de27 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 29 Apr 2025 18:26:36 +0200 Subject: [PATCH] clang-format: Add IncludeSortKey option Sorting by stem giv

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- clang/include/clang/Format/Format.h clang/include/

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Daan De Meyer via cfe-commits
DaanDeMeyer wrote: @HazardyKnusperkeks @owenca Updated PR to introduce a new option `IncludeSortKey`, PTAL! https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-01 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer edited https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits