#
c71fbdd8 |
| 03-Nov-2021 |
Quinn Pham <Quinn.Pham@ibm.com> |
[NFC] Inclusive language: Remove instances of master in URLs
[NFC] This patch fixes URLs containing "master". Old URLs were either broken or redirecting to the new URL.
Reviewed By: #libc, ldionne,
[NFC] Inclusive language: Remove instances of master in URLs
[NFC] This patch fixes URLs containing "master". Old URLs were either broken or redirecting to the new URL.
Reviewed By: #libc, ldionne, mehdi_amini
Differential Revision: https://reviews.llvm.org/D113186
show more ...
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
#
a44ab170 |
| 23-Sep-2021 |
mydeveloperday <mydeveloperday@gmail.com> |
[clang-format] Add Left/Right Const fixer capability
Developers these days seem to argue over east vs west const like they used to argue over tabs vs whitespace or the various bracing style. These p
[clang-format] Add Left/Right Const fixer capability
Developers these days seem to argue over east vs west const like they used to argue over tabs vs whitespace or the various bracing style. These previous arguments were mainly eliminated with tools like `clang-format` that allowed those rules to become part of your style guide. Anyone who has been using clang-format in a large team over the last couple of years knows that we don't have those religious arguments any more, and code reviews are more productive.
https://www.youtube.com/watch?v=fv--IKZFVO8 https://mariusbancila.ro/blog/2018/11/23/join-the-east-const-revolution/ https://www.youtube.com/watch?v=z6s6bacI424
The purpose of this revision is to try to do the same for the East/West const discussion. Move the debate into the style guide and leave it there!
In addition to the new `ConstStyle: Right` or `ConstStyle: Left` there is an additional command-line argument `--const-style=left/right` which would allow an individual developer to switch the source back and forth to their own style for editing, and back to the committed style before commit. (you could imagine an IDE might offer such a switch)
The revision works by implementing a separate pass of the Annotated lines much like the SortIncludes and then create replacements for constant type declarations.
Differential Revision: https://reviews.llvm.org/D69764
show more ...
|
#
f1191705 |
| 20-Sep-2021 |
Nico Weber <thakis@chromium.org> |
[clang] Fix a few comment typos to cycle bots
|
Revision tags: llvmorg-13.0.0-rc3 |
|
#
4b1fde8a |
| 28-Aug-2021 |
owenca <owenpiano@gmail.com> |
[clang-format] Add PackConstructorInitializers backward compat test
Add backward compatibility tests for mapping the deprecated ConstructorInitializerAllOnOneLineOrOnePerLine and AllowAllConstructor
[clang-format] Add PackConstructorInitializers backward compat test
Add backward compatibility tests for mapping the deprecated ConstructorInitializerAllOnOneLineOrOnePerLine and AllowAllConstructorInitializersOnNextLine to PackConstructorInitializers.
Differential Revision: https://reviews.llvm.org/D108882
show more ...
|
#
170a3c6f |
| 27-Aug-2021 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix AllowAllConstructorInitializersOnNextLine value
The default value of the now deprecated AllowAllConstructorInitializersOnNextLine was always true regardless of the value of BasedO
[clang-format] Fix AllowAllConstructorInitializersOnNextLine value
The default value of the now deprecated AllowAllConstructorInitializersOnNextLine was always true regardless of the value of BasedOnStyle. This patch fixes the typo in the code that handles the related backward compatibility.
show more ...
|
Revision tags: llvmorg-13.0.0-rc2 |
|
#
8a780a2f |
| 25-Aug-2021 |
owenca <owenpiano@gmail.com> |
[clang-format] Group options that pack constructor initializers
Add a new option PackConstructorInitializers and deprecate the related options ConstructorInitializerAllOnOneLineOrOnePerLine and Allo
[clang-format] Group options that pack constructor initializers
Add a new option PackConstructorInitializers and deprecate the related options ConstructorInitializerAllOnOneLineOrOnePerLine and AllowAllConstructorInitializersOnNextLine. Below is the mapping:
PackConstructorInitializers ConstructorInitializer... AllowAll... Never - - BinPack false - CurrentLine true false NextLine true true
The option value Never fixes PR50549 by always placing each constructor initializer on its own line.
Differential Revision: https://reviews.llvm.org/D108752
show more ...
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4 |
|
#
8b7881a0 |
| 26-Jun-2021 |
mydeveloperday <mydeveloperday@gmail.com> |
[clang-format] Add basic support for formatting JSON
I find as I develop I'm moving between many different languages C++,C#,JavaScript all the time. As I move between the file types I like to keep `
[clang-format] Add basic support for formatting JSON
I find as I develop I'm moving between many different languages C++,C#,JavaScript all the time. As I move between the file types I like to keep `clang-format` as my formatting tool of choice. (hence why I initially added C# support in {D58404}) I know those other languages have their own tools but I have to learn them all, and I have to work out how to configure them, and they may or may not have integration into my IDE or my source code integration.
I am increasingly finding that I'm editing additional JSON files as part of my daily work and my editor and git commit hooks are just not setup to go and run [[ https://stedolan.github.io/jq/ | jq ]], So I tend to go to [[ https://jsonformatter.curiousconcept.com/ | JSON Formatter ]] and copy and paste back and forth. To get nicely formatted JSON. This is a painful process and I'd like a new one that causes me much less friction.
This has come up from time to time:
{D10543} https://stackoverflow.com/questions/35856565/clang-format-a-json-file https://bugs.llvm.org/show_bug.cgi?id=18699
I would like to stop having to do that and have formatting JSON as a first class clang-format support `Language` (even if it has minimal style settings at present).
This revision adds support for formatting JSON using the inbuilt JSON serialization library of LLVM, With limited control at present only over the indentation level
This adds an additional Language into the .clang-format file to separate the settings from your other supported languages.
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D93528
show more ...
|
Revision tags: llvmorg-12.0.1-rc3 |
|
#
e5c7c171 |
| 23-Jun-2021 |
Martin Storsjö <martin@martin.st> |
[clang] Rename StringRef _lower() method calls to _insensitive()
This is mostly a mechanical change, but a testcase that contains parts of the StringRef class (clang/test/Analysis/llvm-conventions.c
[clang] Rename StringRef _lower() method calls to _insensitive()
This is mostly a mechanical change, but a testcase that contains parts of the StringRef class (clang/test/Analysis/llvm-conventions.cpp) isn't touched.
show more ...
|
#
a08fa8a5 |
| 24-Jun-2021 |
Seraphime Kirkovski <skirkovski@vmware.com> |
[Clang-Format] Add ReferenceAlignment directive
This introduces ReferenceAlignment style option modeled around PointerAlignment. Style implementors can specify Left, Right, Middle or Pointer to foll
[Clang-Format] Add ReferenceAlignment directive
This introduces ReferenceAlignment style option modeled around PointerAlignment. Style implementors can specify Left, Right, Middle or Pointer to follow whatever the PointerAlignment option specifies.
Differential Revision: https://reviews.llvm.org/D104096
show more ...
|
Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
#
be9a87fe |
| 18-May-2021 |
Vitali Lovich <vlovich@gmail.com> |
[clang-format] Add IfMacros option
https://bugs.llvm.org/show_bug.cgi?id=49354
Differential Revision: https://reviews.llvm.org/D102730
|
#
64cf5eba |
| 22-Jun-2021 |
Vitali Lovich <vlovich@gmail.com> |
[clang-format] Add new LambdaBodyIndentation option
Currently the lambda body indents relative to where the lambda signature is located. This instead lets the user choose to align the lambda body re
[clang-format] Add new LambdaBodyIndentation option
Currently the lambda body indents relative to where the lambda signature is located. This instead lets the user choose to align the lambda body relative to the parent scope that contains the lambda declaration. Thus:
someFunction([] { lambdaBody(); });
will always have the same indentation of the body even when the lambda signature goes on a new line:
someFunction( [] { lambdaBody(); });
whereas before lambdaBody would be indented 6 spaces.
Differential Revision: https://reviews.llvm.org/D102706
show more ...
|
#
673c5ba5 |
| 13-Jun-2021 |
Fred Grim <fgrim@apple.com> |
[clang-format] Adds a formatter for aligning arrays of structs
This adds a new formatter to arrange array of struct initializers into neat columns.
Differential Revision: https://reviews.llvm.org/D
[clang-format] Adds a formatter for aligning arrays of structs
This adds a new formatter to arrange array of struct initializers into neat columns.
Differential Revision: https://reviews.llvm.org/D101868
show more ...
|
#
6f605b8d |
| 03-Jun-2021 |
Gerhard Gappmeier <gerhard.gappmeier@ascolab.com> |
[clang-format] Add PPIndentWidth option
This allows to set a different indent width for preprocessor statements.
Example:
#ifdef __linux_ # define FOO #endif
int main(void) { return 0; }
[clang-format] Add PPIndentWidth option
This allows to set a different indent width for preprocessor statements.
Example:
#ifdef __linux_ # define FOO #endif
int main(void) { return 0; }
Differential Revision: https://reviews.llvm.org/D103286
show more ...
|
#
09b75f48 |
| 26-May-2021 |
Zhihao Yuan <zhihao.yuan@broadcom.com> |
[clang-format] New BreakInheritanceList style AfterComma
This inheritance list style has been widely adopted by Symantec, a division of Broadcom Inc. It breaks after the commas that separate the bas
[clang-format] New BreakInheritanceList style AfterComma
This inheritance list style has been widely adopted by Symantec, a division of Broadcom Inc. It breaks after the commas that separate the base-specifiers:
class Derived : public Base1, private Base2 { };
Differential Revision: https://reviews.llvm.org/D103204
show more ...
|
#
9ef66ed4 |
| 25-May-2021 |
Björn Schäpers <bjoern@hazardy.de> |
[clang-format][NFC] correctly sort StatementAttributeLike-macros' IO.map
|
#
61dc0f2b |
| 04-May-2021 |
Nathan James <n.james93@hotmail.co.uk> |
[Format] Don't sort includes if DisableFormat is true
Fixes https://llvm.org/PR35099.
I'm not sure if this decision was intentional but its definitely confusing for users.
Reviewed By: MyDeveloper
[Format] Don't sort includes if DisableFormat is true
Fixes https://llvm.org/PR35099.
I'm not sure if this decision was intentional but its definitely confusing for users.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, curdeius
Differential Revision: https://reviews.llvm.org/D101628
show more ...
|
#
8d93d7ff |
| 03-May-2021 |
Marek Kurdej <marek.kurdej+llvm.org@gmail.com> |
[clang-format] Add options to AllowShortIfStatementsOnASingleLine to apply to "else if" and "else".
This fixes the bug http://llvm.org/pr50019.
Reviewed By: MyDeveloperDay
Differential Revision: h
[clang-format] Add options to AllowShortIfStatementsOnASingleLine to apply to "else if" and "else".
This fixes the bug http://llvm.org/pr50019.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D100727
show more ...
|
#
9363aa90 |
| 29-Apr-2021 |
Marek Kurdej <marek.kurdej+llvm.org@gmail.com> |
[clang-format] Add `SpacesInAngles: Leave` option to keep spacing inside angle brackets as is.
A need for such an option came up in a few libc++ reviews. That's because libc++ has both code in C++03
[clang-format] Add `SpacesInAngles: Leave` option to keep spacing inside angle brackets as is.
A need for such an option came up in a few libc++ reviews. That's because libc++ has both code in C++03 and newer standards. Currently, it uses `Standard: C++03` setting for clang-format, but this breaks e.g. u8"string" literals. Also, angle brackets are the only place where C++03-specific formatting needs to be applied.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D101344
show more ...
|
#
17139b2b |
| 27-Apr-2021 |
Marek Kurdej <marek.kurdej+llvm.org@gmail.com> |
[clang-format] Reformat. NFC.
|
#
dda978ee |
| 15-Apr-2021 |
Max Sagebaum <max.sagebaum@scicomp.uni-kl.de> |
[clang-format] Option for empty lines after an access modifier.
The current logic for access modifiers in classes ignores the option 'MaxEmptyLinesToKeep=1'. It is therefore impossible to have a cod
[clang-format] Option for empty lines after an access modifier.
The current logic for access modifiers in classes ignores the option 'MaxEmptyLinesToKeep=1'. It is therefore impossible to have a coding style that requests one empty line after an access modifier. The patch allows the user to configure how many empty lines clang-format should add after an access modifier. This will remove lines if there are to many and will add them if there are missing.
Reviewed By: MyDeveloperDay, curdeius
Differential Revision: https://reviews.llvm.org/D98237
show more ...
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
#
587859d9 |
| 09-Mar-2021 |
Krasimir Georgiev <krasimir@google.com> |
clang-format: use `pb` as a canonical raw string delimiter for google style
This updates the canonical text proto raw string delimiter to `pb` for Google style, moving codebases towards a simpler an
clang-format: use `pb` as a canonical raw string delimiter for google style
This updates the canonical text proto raw string delimiter to `pb` for Google style, moving codebases towards a simpler and more consistent style.
Also updates a behavior where the canonical delimiter was not applied for raw strings with empty delimiters detected via well-known enclosing functions that expect a text proto, effectively making the canonical delimiter more viral. This feature is not widely used so this should be safe and more in line with promoting the canonicity of the canonical delimiter.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D97688
show more ...
|
Revision tags: llvmorg-12.0.0-rc3 |
|
#
7b02794f |
| 04-Mar-2021 |
Björn Schäpers <bjoern@hazardy.de> |
[clang-format] Rename case sorting
As discussed in D95017 the names case sensitive and insensitive should be switched.
This amends a8105b3766e4.
Differential Revision: https://reviews.llvm.org/D97
[clang-format] Rename case sorting
As discussed in D95017 the names case sensitive and insensitive should be switched.
This amends a8105b3766e4.
Differential Revision: https://reviews.llvm.org/D97927
show more ...
|
Revision tags: llvmorg-12.0.0-rc2 |
|
#
e7309404 |
| 16-Feb-2021 |
Björn Schäpers <bjoern@hazardy.de> |
[clang-format] Suppress diagnostics on second parse
This amends 25f753c51e7b17bfca08155c1d777c5667110970.
When applying the child configurations we don't need any diagnostic, because it was issued
[clang-format] Suppress diagnostics on second parse
This amends 25f753c51e7b17bfca08155c1d777c5667110970.
When applying the child configurations we don't need any diagnostic, because it was issued when first parsing them. So just drop everything on the second parse.
Differential Revision: https://reviews.llvm.org/D96760
show more ...
|
#
6ca52815 |
| 01-Mar-2021 |
Krystian Kuzniarek <krystian.kuzniarek@gmail.com> |
[clang-format][PR47290] Add ShortNamespaceLines format option
clang-format documentation states that having enabled FixNamespaceComments one may expect below code:
c++ namespace a { foo(); }
to be
[clang-format][PR47290] Add ShortNamespaceLines format option
clang-format documentation states that having enabled FixNamespaceComments one may expect below code:
c++ namespace a { foo(); }
to be turned into:
c++ namespace a { foo(); } // namespace a
In reality, no "// namespace a" was added. The problem was too high value of kShortNamespaceMaxLines, which is used while deciding whether a namespace is long enough to be formatted.
As with 9163fe2, clang-format idempotence is preserved.
Differential Revision: https://reviews.llvm.org/D87587
show more ...
|
#
2a42c759 |
| 26-Feb-2021 |
Jakub Budiský <jakub.budisky@gmail.com> |
[clang-format] [PR19056] Add support for access modifiers indentation
Adds support for coding styles that make a separate indentation level for access modifiers, such as Code::Blocks or QtCreator.
[clang-format] [PR19056] Add support for access modifiers indentation
Adds support for coding styles that make a separate indentation level for access modifiers, such as Code::Blocks or QtCreator.
The new option, `IndentAccessModifiers`, if enabled, forces the content inside classes, structs and unions (“records”) to be indented twice while removing a level for access modifiers. The value of `AccessModifierOffset` is disregarded in this case, aiming towards an ease of use.
====== The PR (https://bugs.llvm.org/show_bug.cgi?id=19056) had an implementation attempt by @MyDeveloperDay already (https://reviews.llvm.org/D60225) but I've decided to start from scratch. They differ in functionality, chosen approaches, and even the option name. The code tries to re-use the existing functionality to achieve this behavior, limiting possibility of breaking something else.
Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D94661
show more ...
|