<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/unittests/Format/SortImportsTestJava.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] 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][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] Remove extraneous newlines in remaining unit tests</title>
<updated>2023-10-27T10:42:16+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2023-10-27T10:35:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9299ace0a20d3ea4d921c033a49364ea6f24263e'/>
<id>9299ace0a20d3ea4d921c033a49364ea6f24263e</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] Add case aware include sorting.</title>
<updated>2021-02-02T14:12:27+00:00</updated>
<author>
<name>Kent Sommer</name>
<email>work@kentsommer.com</email>
</author>
<published>2021-02-02T13:41:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a8105b3766e4195ca2390cd0714e07406bc8a4a5'/>
<id>a8105b3766e4195ca2390cd0714e07406bc8a4a5</id>
<content type='text'>
Adds an option to [clang-format] which sorts headers in an alphabetical manner using case only for tie-breakers. The options is off by default in favor of the current ASCIIbetical sorting style.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D95017
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds an option to [clang-format] which sorts headers in an alphabetical manner using case only for tie-breakers. The options is off by default in favor of the current ASCIIbetical sorting style.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D95017
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Add a option for the position of Java static import</title>
<updated>2020-09-18T17:12:21+00:00</updated>
<author>
<name>mydeveloperday</name>
<email>mydeveloperday@gmail.com</email>
</author>
<published>2020-09-18T17:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e7add812eb7bdd90bd0f0fc3b633515edd55f27'/>
<id>2e7add812eb7bdd90bd0f0fc3b633515edd55f27</id>
<content type='text'>
 Some Java style guides and IDEs group Java static imports after
 non-static imports. This patch allows clang-format to control
 the location of static imports.

Patch by: @bc-lee

Reviewed By: MyDeveloperDay, JakeMerdichAMD

Differential Revision: https://reviews.llvm.org/D87201
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 Some Java style guides and IDEs group Java static imports after
 non-static imports. This patch allows clang-format to control
 the location of static imports.

Patch by: @bc-lee

Reviewed By: MyDeveloperDay, JakeMerdichAMD

Differential Revision: https://reviews.llvm.org/D87201
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed</title>
<updated>2019-10-01T20:20:22+00:00</updated>
<author>
<name>Paul Hoad</name>
<email>mydeveloperday@gmail.com</email>
</author>
<published>2019-10-01T20:20:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=603650213b1aee2a03ba879ba9d8e6eb65a06694'/>
<id>603650213b1aee2a03ba879ba9d8e6eb65a06694</id>
<content type='text'>
Summary:
This is a patch to fix PR43372 (https://bugs.llvm.org/show_bug.cgi?id=43372) - clang-format can't format file with includes, ( which really keep providing replacements for already sorted headers.)

A similar issue was addressed by @krasimir in {D60199}, however, this seemingly only prevented the issue when the files being formatted did not contain windows line endings (\r\n)

It's possible this is related to https://twitter.com/StephanTLavavej/status/1176722938243895296 given who @STL_MSFT  works for!

As people often used the existence of replacements to determine if a file needs clang-formatting, this is probably pretty important for windows users

There may be a better way of comparing 2 strings and ignoring \r (which appear in both Results and Code), I couldn't choose between this idiom or the copy_if approach, but I'm happy to change it to whatever people consider more performant.

Reviewers: krasimir, klimek, owenpan, ioeric

Reviewed By: krasimir

Subscribers: cfe-commits, STL_MSFT, krasimir

Tags: #clang-format, #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D68227

llvm-svn: 373388
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This is a patch to fix PR43372 (https://bugs.llvm.org/show_bug.cgi?id=43372) - clang-format can't format file with includes, ( which really keep providing replacements for already sorted headers.)

A similar issue was addressed by @krasimir in {D60199}, however, this seemingly only prevented the issue when the files being formatted did not contain windows line endings (\r\n)

It's possible this is related to https://twitter.com/StephanTLavavej/status/1176722938243895296 given who @STL_MSFT  works for!

As people often used the existence of replacements to determine if a file needs clang-formatting, this is probably pretty important for windows users

There may be a better way of comparing 2 strings and ignoring \r (which appear in both Results and Code), I couldn't choose between this idiom or the copy_if approach, but I'm happy to change it to whatever people consider more performant.

Reviewers: krasimir, klimek, owenpan, ioeric

Reviewed By: krasimir

Subscribers: cfe-commits, STL_MSFT, krasimir

Tags: #clang-format, #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D68227

llvm-svn: 373388
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] [PR41187] moves Java import statements to the wrong location if code contains statements that start with the word import</title>
<updated>2019-03-30T13:05:40+00:00</updated>
<author>
<name>Paul Hoad</name>
<email>mydeveloperday@gmail.com</email>
</author>
<published>2019-03-30T13:05:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=88335c21a4664b20e0772fc01e022c681e26eae4'/>
<id>88335c21a4664b20e0772fc01e022c681e26eae4</id>
<content type='text'>
Summary:
Import sorting of java file, incorrectly move import statement to after a function beginning with the word import.

Make 1 character change to regular expression to ensure there is always at least one space/tab after the word import

Previously clang-format --style="LLVM" would format

```
import X;

class C {
  void m() {
    importFile();
  }
}
```
as

```
class C {
  void m() {
    importFile();
import X;
  }
}
```

Reviewers: djasper, klimek, reuk, JonasToth

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D59684

llvm-svn: 357345
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Import sorting of java file, incorrectly move import statement to after a function beginning with the word import.

Make 1 character change to regular expression to ensure there is always at least one space/tab after the word import

Previously clang-format --style="LLVM" would format

```
import X;

class C {
  void m() {
    importFile();
  }
}
```
as

```
class C {
  void m() {
    importFile();
import X;
  }
}
```

Reviewers: djasper, klimek, reuk, JonasToth

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D59684

llvm-svn: 357345
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Do not emit replacements if Java imports are OK</title>
<updated>2019-02-20T11:44:21+00:00</updated>
<author>
<name>Krasimir Georgiev</name>
<email>krasimir@google.com</email>
</author>
<published>2019-02-20T11:44:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=777bb8253393ef5b76443b6a95fdb4f7c89a1dd9'/>
<id>777bb8253393ef5b76443b6a95fdb4f7c89a1dd9</id>
<content type='text'>
Summary:
Currently clang-format would always emit a replacement for a block of Java imports even if it is correctly formatted:
```
% cat /tmp/Aggregator.java
import X;
% clang-format /tmp/Aggregator.java
import X;
% clang-format -output-replacements-xml /tmp/Aggregator.java
&lt;?xml version='1.0'?&gt;
&lt;replacements xml:space='preserve' incomplete_format='false'&gt;
&lt;replacement offset='0' length='9'&gt;import X;&lt;/replacement&gt;
&lt;/replacements&gt;
%
```
This change makes clang-format not emit replacements in this case. Note that
there is logic to not emit replacements in this case for C++.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58436

llvm-svn: 354452
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Currently clang-format would always emit a replacement for a block of Java imports even if it is correctly formatted:
```
% cat /tmp/Aggregator.java
import X;
% clang-format /tmp/Aggregator.java
import X;
% clang-format -output-replacements-xml /tmp/Aggregator.java
&lt;?xml version='1.0'?&gt;
&lt;replacements xml:space='preserve' incomplete_format='false'&gt;
&lt;replacement offset='0' length='9'&gt;import X;&lt;/replacement&gt;
&lt;/replacements&gt;
%
```
This change makes clang-format not emit replacements in this case. Note that
there is logic to not emit replacements in this case for C++.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58436

llvm-svn: 354452
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Java import sorting in clang-format</title>
<updated>2018-10-05T17:19:26+00:00</updated>
<author>
<name>Krasimir Georgiev</name>
<email>krasimir@google.com</email>
</author>
<published>2018-10-05T17:19:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7e91b0334866b2b01ac2df75b2a389e131df5c94'/>
<id>7e91b0334866b2b01ac2df75b2a389e131df5c94</id>
<content type='text'>
Contributed by SamMaier!

llvm-svn: 343862
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Contributed by SamMaier!

llvm-svn: 343862
</pre>
</div>
</content>
</entry>
</feed>
