<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/unittests/Format/SortIncludesTest.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[clang-format][NFC] Clean up around StringRef initializations (#149765)</title>
<updated>2025-07-22T02:11:17+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-07-22T02:11:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d48996ff05305d4a5774f3e232c2ee4a06c3d2a'/>
<id>4d48996ff05305d4a5774f3e232c2ee4a06c3d2a</id>
<content type='text'>
Consistently use `constexpr StringRef Code("string literal");`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Consistently use `constexpr StringRef Code("string literal");`.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Add IgnoreExtension to SortIncludes (#137840)</title>
<updated>2025-07-17T07:36:52+00:00</updated>
<author>
<name>Daan De Meyer</name>
<email>daan.j.demeyer@gmail.com</email>
</author>
<published>2025-07-17T07:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1653a093def10543d8f958fe7d4cde9ab1dd8bca'/>
<id>1653a093def10543d8f958fe7d4cde9ab1dd8bca</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Upgrade SortIncludes option to a struct (#140497)</title>
<updated>2025-05-19T08:32:17+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-05-19T08:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ddcd765dbb088b3fe8eb09dd38db1252981962c'/>
<id>5ddcd765dbb088b3fe8eb09dd38db1252981962c</id>
<content type='text'>
This allows adding other suboptions e.g. IgnoreExtension in #137840.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows adding other suboptions e.g. IgnoreExtension in #137840.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Don't sort includes for C# (#129369)</title>
<updated>2025-03-04T01:40:02+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-03-04T01:40:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0ed2945a596991b75e4ca090fe04240abba6012b'/>
<id>0ed2945a596991b75e4ca090fe04240abba6012b</id>
<content type='text'>
Fixes #106194</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #106194</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Skip line splices when sorting C++ includes (#120680)</title>
<updated>2024-12-25T05:47:53+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2024-12-25T05:47:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=141c544c03702ac7c50522373ad781ede3685e0a'/>
<id>141c544c03702ac7c50522373ad781ede3685e0a</id>
<content type='text'>
Fixes #109864.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #109864.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Skip block commented out includes when sorting them (#97787)</title>
<updated>2024-07-05T22:28:16+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2024-07-05T22:28:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ceade83ad5fc529f2b2beb896eec0dd0b29fdd44'/>
<id>ceade83ad5fc529f2b2beb896eec0dd0b29fdd44</id>
<content type='text'>
Fixes #97539.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #97539.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Remove redundnat llvm::, clang::, etc.</title>
<updated>2024-05-21T03:32:18+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2024-05-21T02:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c58208d899285318c89e069268145c85ec33368'/>
<id>1c58208d899285318c89e069268145c85ec33368</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Clean up SortIncludesTest.cpp</title>
<updated>2024-05-19T22:19:05+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2024-05-19T22:09:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2d5e488c98225108aebfe4aa4acfe6ec1f234a37'/>
<id>2d5e488c98225108aebfe4aa4acfe6ec1f234a37</id>
<content type='text'>
Wherever applicable, replace EXPECT_EQ with verifyFormat and std::string
with StringRef. Also, change a raw string literal to a regular one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wherever applicable, replace EXPECT_EQ with verifyFormat and std::string
with StringRef. Also, change a raw string literal to a regular one.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Do not update cursor pos if no includes replacement (#77456)</title>
<updated>2024-04-26T03:34:49+00:00</updated>
<author>
<name>NorthBlue333</name>
<email>43409865+NorthBlue333@users.noreply.github.com</email>
</author>
<published>2024-04-26T03:34:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2de0bedfebb77a6c8a5b0d00902f796fa4022fd6'/>
<id>2de0bedfebb77a6c8a5b0d00902f796fa4022fd6</id>
<content type='text'>
Fix https://github.com/llvm/llvm-project/issues/77450.

---------

Signed-off-by: NorthBlue333 &lt;north333@free.fr&gt;
Co-authored-by: Owen Pan &lt;owenpiano@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix https://github.com/llvm/llvm-project/issues/77450.

---------

Signed-off-by: NorthBlue333 &lt;north333@free.fr&gt;
Co-authored-by: Owen Pan &lt;owenpiano@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Add MainIncludeChar option. (#78752)</title>
<updated>2024-02-06T09:06:33+00:00</updated>
<author>
<name>j-jorge</name>
<email>j-jorge@users.noreply.github.com</email>
</author>
<published>2024-02-06T09:06:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=984dd15d4da33337b2800d4776aa8ecc168b145e'/>
<id>984dd15d4da33337b2800d4776aa8ecc168b145e</id>
<content type='text'>
Resolves #27008, #39735, #53013, #63619.

Hello, this PR adds the MainIncludeChar option to clang-format, allowing
to select which include syntax must be considered when searching for the
main header: quotes (`#include "foo.hpp"`, the default), brackets
(`#include &lt;foo.hpp&gt;`), or both.

The lack of support for brackets has been reported many times, see the
linked issues, so I am pretty sure there is a need for it :)

A short note about why I did not implement a regex approach as discussed
in #53013: while a regex would have allowed many extra ways to describe
the main header, the bug descriptions listed above suggest a very simple
need: support brackets for the main header. This PR answers this needs
in a quite simple way, with a very simple style option. IMHO the feature
space covered by the regex (again, for which there is no demand :)) can
be implemented latter, in addition to the proposed option.

The PR also includes tests for the option with and without grouped
includes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Resolves #27008, #39735, #53013, #63619.

Hello, this PR adds the MainIncludeChar option to clang-format, allowing
to select which include syntax must be considered when searching for the
main header: quotes (`#include "foo.hpp"`, the default), brackets
(`#include &lt;foo.hpp&gt;`), or both.

The lack of support for brackets has been reported many times, see the
linked issues, so I am pretty sure there is a need for it :)

A short note about why I did not implement a regex approach as discussed
in #53013: while a regex would have allowed many extra ways to describe
the main header, the bug descriptions listed above suggest a very simple
need: support brackets for the main header. This PR answers this needs
in a quite simple way, with a very simple style option. IMHO the feature
space covered by the regex (again, for which there is no demand :)) can
be implemented latter, in addition to the proposed option.

The PR also includes tests for the option with and without grouped
includes.</pre>
</div>
</content>
</entry>
</feed>
