History log of /llvm-project/clang/tools/clang-format/ClangFormat.cpp (Results 1 – 25 of 142)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6
# 56ab56c8 03-Dec-2024 Jim B <d3x0r@users.noreply.github.com>

[clang-format] Add support for `.cjs` as JavaScript file extension (#118188)

Node uses `.cjs` as an extension for 'common javascript' modules.


Revision tags: llvmorg-19.1.5
# b9731a47 25-Nov-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][doc] Minor cleanup


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3
# 801f3a54 26-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Print the names of unfound files in error messages (#113640)

Also fix the return status when `-i` is used with reading from stdin.

Fixes #113631.


# f24c1dd0 25-Oct-2024 Simon Pilgrim <llvm-dev@redking.me.uk>

Fix MSVC "signed/unsigned mismatch" warning. NFC.


# efd8938d 25-Oct-2024 kakkoko <parenthesized.ko@gmail.com>

[clang-format] Fix working -assume-filename with .clang-format-ignore (#113100)

Fixes #113099.

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>


# 85df2818 19-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug that always returns error for JSON (#112839)

Fixes #108556.


Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 4f4bd41f 01-Sep-2024 c8ef <c8ef@outlook.com>

[NFC] Fix typos (#106817)

Fixes #106761.


Revision tags: llvmorg-19.1.0-rc3
# 986bc3d0 10-Aug-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a serious bug in `git clang-format -f` (#102629)

With the --force (or -f) option, git-clang-format wipes out input files
excluded by a .clang-format-ignore file if they have unst

[clang-format] Fix a serious bug in `git clang-format -f` (#102629)

With the --force (or -f) option, git-clang-format wipes out input files
excluded by a .clang-format-ignore file if they have unstaged changes.

This patch adds a hidden clang-format option --list-ignored that lists
such excluded files for git-clang-format to filter out.

Fixes #102459.

show more ...


Revision tags: llvmorg-19.1.0-rc2
# 9fa17fea 02-Aug-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle parenthesized list in RemoveParentheses (#100852)

Also, reformat clang-format source to remove redundant parentheses
enclosing single list items.

Fixes #100768.


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8
# c967c7e0 07-Jun-2024 Nour <nourr313@proton.me>

[clang-format][NFC] Remove an else after a return statement (#94548)


Revision tags: llvmorg-18.1.7
# 1c58208d 21-May-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Remove redundnat llvm::, clang::, etc.


Revision tags: llvmorg-18.1.6
# b11a6607 16-May-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Reformat with 18.1.5


Revision tags: llvmorg-18.1.5
# e22ce615 01-May-2024 Sean Perry <39927768+perry-ca@users.noreply.github.com>

[z/OS] treat text files as text files so auto-conversion is done (#90128)

To support auto-conversion on z/OS text files need to be opened as text files. These changes will fix a number of LIT failur

[z/OS] treat text files as text files so auto-conversion is done (#90128)

To support auto-conversion on z/OS text files need to be opened as text files. These changes will fix a number of LIT failures due to text files not being converted to the internal code page.

update a number of tools so they open the text files as text files
add support in the cat.py to open a text file as a text file (Windows will continue to treat all files as binary so new lines are handled correctly)
add env var definitions to enable auto-conversion in the lit config file.

show more ...


Revision tags: llvmorg-18.1.4
# 6dbd4bb3 12-Apr-2024 Jing Wang <2019426+jingw@users.noreply.github.com>

Add txtpb to the list of supported TextProto extensions (#88355)

According to
https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files,
txtpb is the canonical extension

Co-aut

Add txtpb to the list of supported TextProto extensions (#88355)

According to
https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files,
txtpb is the canonical extension

Co-authored-by: Jing Wang <99jingw@gmail.com>

show more ...


Revision tags: llvmorg-18.1.3
# a29e9e32 21-Mar-2024 Roberto Bampi <gigaroby@users.noreply.github.com>

[clang-format] Add --fail-on-incomplete-format. (#84346)

At the moment clang-format will return exit code 0 on incomplete
results. In scripts it would sometimes be useful if clang-format would
ins

[clang-format] Add --fail-on-incomplete-format. (#84346)

At the moment clang-format will return exit code 0 on incomplete
results. In scripts it would sometimes be useful if clang-format would
instead fail in those cases, signalling that there was something wrong
with the code being formatted.

---------

Co-authored-by: Björn Schäpers <github@hazardy.de>
Co-authored-by: Owen Pan <owenpiano@gmail.com>

show more ...


# b2082a98 20-Mar-2024 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files"

This reverts commit b92d6dd704d789240685a336ad8b25a9f381b4cc. See
github.com/llvm/llvm-project/commit/b92d6dd704d7#com

Revert "[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files"

This reverts commit b92d6dd704d789240685a336ad8b25a9f381b4cc. See
github.com/llvm/llvm-project/commit/b92d6dd704d7#commitcomment-139992444

We should use a tool like Visual Studio to clean up the headers.

show more ...


Revision tags: llvmorg-18.1.2
# b92d6dd7 17-Mar-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files


Revision tags: llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3
# 8f6e13e6 08-Feb-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a regression in dumping the config (#80628)

Commit d813af73f70f addressed a regression introduced by commit
3791b3fca6ea
but caused `clang-format -dump-config` to "hang".

Thi

[clang-format] Fix a regression in dumping the config (#80628)

Commit d813af73f70f addressed a regression introduced by commit
3791b3fca6ea
but caused `clang-format -dump-config` to "hang".

This patch reverts changes to ClangFormat.cpp by both commits and
reworks the cleanup.

Fixes #80621.

show more ...


Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# d813af73 23-Jan-2024 Ben Hamilton (Ben Gertzfield) <benhamilton@google.com>

[Format] Fix detection of languages when reading from stdin (#79051)

The code cleanup in #74794 accidentally broke detection of languages by
reading file content from stdin, e.g. via `clang-format

[Format] Fix detection of languages when reading from stdin (#79051)

The code cleanup in #74794 accidentally broke detection of languages by
reading file content from stdin, e.g. via `clang-format -dump-config - <
/path/to/filename`.

This PR adds unit and integration tests to reproduce the issue and adds
a fix.

Fixes: #79023

show more ...


# b53628a5 04-Jan-2024 Owen Pan <owenpiano@gmail.com>

Reland "[clang-format] Optimize processing .clang-format-ignore files"

(42ec976184ac was reverted by 26993f61673e due to a use-after-scope bug.)

Reuse the patterns governing the previous input file

Reland "[clang-format] Optimize processing .clang-format-ignore files"

(42ec976184ac was reverted by 26993f61673e due to a use-after-scope bug.)

Reuse the patterns governing the previous input file being formatted if
the current input file is from the same directory.

show more ...


# 26993f61 04-Jan-2024 Mitch Phillips <mitchp@google.com>

Revert "[clang-format] Optimize processing .clang-format-ignore files (#76733)"

This reverts commit 42ec976184acd40436acd7104ad715c60ca3e7ed.

Reason: Broke the sanitizer buildbots. See more informa

Revert "[clang-format] Optimize processing .clang-format-ignore files (#76733)"

This reverts commit 42ec976184acd40436acd7104ad715c60ca3e7ed.

Reason: Broke the sanitizer buildbots. See more information on the
github comment thread at
https://github.com/llvm/llvm-project/commit/42ec976184acd40436acd7104ad715c60ca3e7ed

show more ...


# 42ec9761 04-Jan-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Optimize processing .clang-format-ignore files (#76733)

Reuse the patterns governing the previous input file being formatted if
the current input file is from the same directory.


# 09308122 30-Dec-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Add .clang-format-ignore for ignoring files (#76327)

Closes #52975.


# 3791b3fc 08-Dec-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Clean up the driver and getStyle() in Format.cpp (#74794)


# 5c60e2ce 01-Dec-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Reformat source code with clang-format style


123456