Commit 1653a09
authored
[clang-format] Add IgnoreExtension to SortIncludes (llvm#137840)
Sorting by stem gives nicer results when various header file names are
substrings of other header file names. For example, a CLI application
with a main header named analyze.h and an analyze-xxx.h header for each
subcommand currently will always put analyze.h last after all the
analyze-xxx.h headers, but putting analyze.h first instead is arguably
nicer to read.
TLDR; Instead of
```
#include "analyze-blame.h"
#include "analyze.h"
```
You'd get
```
#include "analyze.h"
#include "analyze-blame.h"
```
Let's allow sorting by stem instead of full path by adding
IgnoreExtension to SortIncludes.1 parent 3cb0c7f commit 1653a09
File tree
5 files changed
+83
-26
lines changed- clang
- docs
- include/clang/Format
- lib/Format
- unittests/Format
5 files changed
+83
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6015 | 6015 | | |
6016 | 6016 | | |
6017 | 6017 | | |
| 6018 | + | |
| 6019 | + | |
| 6020 | + | |
| 6021 | + | |
| 6022 | + | |
| 6023 | + | |
| 6024 | + | |
| 6025 | + | |
| 6026 | + | |
| 6027 | + | |
6018 | 6028 | | |
6019 | 6029 | | |
6020 | 6030 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4385 | 4385 | | |
4386 | 4386 | | |
4387 | 4387 | | |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
4388 | 4397 | | |
4389 | | - | |
| 4398 | + | |
| 4399 | + | |
4390 | 4400 | | |
4391 | 4401 | | |
4392 | 4402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
| 668 | + | |
| 669 | + | |
669 | 670 | | |
670 | 671 | | |
671 | | - | |
| 672 | + | |
| 673 | + | |
672 | 674 | | |
673 | 675 | | |
674 | 676 | | |
675 | 677 | | |
676 | 678 | | |
677 | | - | |
| 679 | + | |
| 680 | + | |
678 | 681 | | |
679 | 682 | | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
| 686 | + | |
683 | 687 | | |
684 | 688 | | |
685 | 689 | | |
| |||
1650 | 1654 | | |
1651 | 1655 | | |
1652 | 1656 | | |
1653 | | - | |
| 1657 | + | |
| 1658 | + | |
1654 | 1659 | | |
1655 | 1660 | | |
1656 | 1661 | | |
| |||
3239 | 3244 | | |
3240 | 3245 | | |
3241 | 3246 | | |
3242 | | - | |
| 3247 | + | |
3243 | 3248 | | |
3244 | | - | |
3245 | | - | |
3246 | | - | |
3247 | | - | |
3248 | | - | |
3249 | | - | |
3250 | | - | |
3251 | | - | |
3252 | | - | |
3253 | | - | |
3254 | | - | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
3255 | 3268 | | |
3256 | 3269 | | |
3257 | 3270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| |||
980 | 981 | | |
981 | 982 | | |
982 | 983 | | |
983 | | - | |
984 | | - | |
985 | | - | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
986 | 988 | | |
987 | 989 | | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
994 | 998 | | |
995 | 999 | | |
996 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1483 | 1483 | | |
1484 | 1484 | | |
1485 | 1485 | | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
1486 | 1506 | | |
1487 | 1507 | | |
1488 | 1508 | | |
0 commit comments