| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.
Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:
MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END
Now, using the options
MacroBlockBegin: "^[A-Z_]+_BEGIN$"
MacroBlockEnd: "^[A-Z_]+_END$"
will yield the expected result:
MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END
Differential Revision: http://reviews.llvm.org/D10840
llvm-svn: 241363
|
|
|
|
|
|
|
|
| |
functions only
Differential Revision: http://reviews.llvm.org/D10774
llvm-svn: 240959
|
|
|
|
|
|
| |
This is a comment-only change to test commit access.
llvm-svn: 240879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In essence this is meant to consistently indent multiline strings by a
fixed amount of spaces from the start of the line. Don't do this in
cases where it wouldn't help anyway.
Before:
someFunction(aaaaa,
"aaaaa"
"bbbbb");
After:
someFunction(aaaaa, "aaaaa"
"bbbbb");
llvm-svn: 240004
|
|
|
|
|
|
|
|
|
|
| |
In the long run, these two might be independent or we might to only
allow specific combinations. Until we have a corresponding request,
however, it is hard to do the right thing and choose the right
configuration options. Thus, just don't touch the options yet and
just modify the behavior slightly.
llvm-svn: 239531
|
|
|
|
| |
llvm-svn: 236965
|
|
|
|
| |
llvm-svn: 236964
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Objective-C some style guides use a style where assignment operators are
aligned, in an effort to increase code readability. This patch adds an option
to the format library which allows this functionality. It is disabled by
default for all the included styles, so it must be explicitly enabled.
The option will change code such as:
- (void)method {
NSNumber *one = @1;
NSNumber *twentyFive = @25;
}
to:
- (void)method {
NSNumber *one = @1;
NSNumber *twentyFive = @25;
}
Patch by Matt Oakes. Thank you!
Accidentally reformatted all the tests...
llvm-svn: 236100
|
|
|
|
| |
llvm-svn: 223118
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;
Without alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;
This fixes llvm.org/PR21666.
llvm-svn: 223117
|
|
|
|
| |
llvm-svn: 220786
|
|
|
|
| |
llvm-svn: 219407
|
|
|
|
|
|
|
| |
This is desirable for the Chromium style guide:
http://www.chromium.org/developers/coding-style
llvm-svn: 219400
|
|
|
|
|
|
| |
Patch by Marek Kurdej, thanks!
llvm-svn: 219204
|
|
|
|
|
|
| |
Fix warning introduced by r211098.
llvm-svn: 217864
|
|
|
|
|
|
|
|
|
| |
This will allow:
int aaaaaaaaaaaaaa =
bbbbbbbbbbbbbb
+ ccccccccccccccc;
llvm-svn: 217757
|
|
|
|
|
|
| |
Fix sphinx warning introduced by r217501.
llvm-svn: 217524
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On a single line:
switch (a) {
case 1: x = 1; return;
case 2: x = 2; return;
default: break;
}
Not on a single line:
switch (a) {
case 1:
x = 1;
return;
case 2:
x = 2;
return;
default:
break;
}
This partly addresses llvm.org/PR16535. In the long run, we probably want to
lay these out in columns.
llvm-svn: 217501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This permits to add a space after closing parenthesis of a C-style cast.
Defaults to false to preserve old behavior.
Fixes llvm.org/PR19982.
Before:
(int)i;
After:
(int) i;
Patch by Marek Kurdej.
llvm-svn: 217022
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int a[5];
a[3] += 42;
After:
int a[ 5 ];
a[ 3 ] += 42;
Fixes LLVM bug #17887 (http://llvm.org/bugs/show_bug.cgi?id=17887).
Patch by Marek Kurdej, thank you!
llvm-svn: 216449
|
|
|
|
| |
llvm-svn: 215443
|
|
|
|
| |
llvm-svn: 214967
|
|
|
|
|
|
|
|
|
|
| |
This is required for GNU coding style, among others.
Also update the configuration documentation.
Modified from an original patch by Jarkko Hietaniemi, thank you!
llvm-svn: 214858
|
|
|
|
| |
llvm-svn: 213651
|
|
|
|
|
|
|
|
|
| |
Though not completely identical, make former
IndentFunctionDeclarationAfterType change this flag for backwards
compatibility (it is somewhat close in meaning and better the err'ing on
an unknown config flag).
llvm-svn: 212597
|
|
|
|
| |
llvm-svn: 212594
|
|
|
|
| |
llvm-svn: 211690
|
|
|
|
|
|
|
| |
Patch by Janusz Sobczak (slightly extended).
This fixes llvm.org/19929.
llvm-svn: 211098
|
|
|
|
|
|
| |
Patch by Adam Strzelecki, thank you!
llvm-svn: 208882
|
|
|
|
|
|
|
|
|
| |
With AllowShortBlocksOnASingleLine, clang-format allows:
if (a) { return; }
Based on patch by Gonzalo BG, thank you!
llvm-svn: 208765
|
|
|
|
| |
llvm-svn: 206661
|
|
|
|
| |
llvm-svn: 205853
|
|
|
|
|
|
|
|
| |
This fixes llvm.org/PR17242.
Patch by Brian Green, thank you!
llvm-svn: 205307
|
|
|
|
|
|
|
|
| |
For reference: llvm.org/PR18690.
Also updated generated help page and page creation script.
llvm-svn: 201323
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The rule from the GNU style states:
"We find it easier to read a program when it has spaces before the open-parentheses and after the commas."
http://www.gnu.org/prep/standards/standards.html#index-spaces-before-open_002dparen
This patch makes clang-format adds an option to put spaces before almost all open parentheses, except the cases, where different behavior is dictated by the style rules or language syntax:
* preprocessor:
** function-like macro definitions can't have a space between the macro name and the parenthesis;
** `#if defined(...)` can have a space, but it seems, that it's more frequently used without a space in GCC, for example;
* never add spaces after unary operators;
* adding spaces between two opening parentheses is controlled with the `SpacesInParentheses` option;
* never add spaces between `[` and `(` (there's no option yet).
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2326
llvm-svn: 196901
|
|
|
|
| |
llvm-svn: 191529
|
|
|
|
| |
llvm-svn: 191528
|
|
|
|
|
|
| |
Patch contributed by Aaron Wishnick. Thank you!
llvm-svn: 191375
|
|
|
|
|
|
|
|
|
|
|
| |
Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.
Differential Revision: http://llvm-reviews.chandlerc.com/D1629
llvm-svn: 190413
|
|
|
|
| |
llvm-svn: 189947
|
|
Summary:
The main contents is in the ClangFormatStyleOptions.rst, which can be
updated from the Format.h by the dump_format_style.py script.
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1597
llvm-svn: 189946
|