| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
typedef NS_ENUM(NSInteger, MyType) {
/// Information about someDecentlyLongValue.
someDecentlyLongValue,
/// Information about anotherDecentlyLongValue.
anotherDecentlyLongValue,
/// Information about aThirdDecentlyLongValue.
aThirdDecentlyLongValue};
After:
typedef NS_ENUM(NSInteger, MyType) {
/// Information about someDecentlyLongValue.
someDecentlyLongValue,
/// Information about anotherDecentlyLongValue.
anotherDecentlyLongValue,
/// Information about aThirdDecentlyLongValue.
aThirdDecentlyLongValue
};
llvm-svn: 200469
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {
aaaaaaaaaaaaaaaa : AAAAAAAAAA,
bbbbbbbbbbbbbbbb : BBBBBBBBBB
}];
After:
repeated double value = 1
[(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa : AAAAAAAAAA,
bbbbbbbbbbbbbbbb : BBBBBBBBBB}];
llvm-svn: 200406
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {
aaaaaaaaaaaaaaaaa : AAAAAAAA
}];
After:
repeated double value = 1
[(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaa : AAAAAAAA}];
llvm-svn: 200405
|
|
|
|
|
|
|
|
| |
The following snippet would crash:
#endif
#if A
llvm-svn: 200381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
ReturnType __attribute__((unused))
function(int i);
After:
ReturnType __attribute__((unused))
function(int i);
This fixes llvm.org/PR18632.
llvm-svn: 200337
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional int32 foo[ default = true, deprecated = true ];
After:
optional int32 foo[default = true, deprecated = true];
llvm-svn: 200327
|
|
|
|
|
|
|
|
|
| |
Mozilla and WebKit seem to use a space after @property (verified by
grepping their codebases) so we turn this on there as well.
Change by Christian Legnitto. Thank you!
llvm-svn: 200320
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Deleted &operator=(const Deleted &)&= default;
Deleted &operator=(const Deleted &)&&= delete;
After:
Deleted &operator=(const Deleted &)& = default;
Deleted &operator=(const Deleted &)&& = delete;
llvm-svn: 200073
|
|
|
|
|
|
|
|
| |
This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not necessary any more.
llvm-svn: 199982
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
std::unique_ptr<int[]> foo() {}
After:
std::unique_ptr<int []> foo() {}
Also, the formatting could go severely wrong after such a function
before.
llvm-svn: 199817
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional really.really.long.and.qualified.type.aaaaaaa
.aaaaaaaa another_fiiiiiiiiiiiiiiiiiiiiield = 2;
After:
optional
really.really.long.and.qualified.type.aaaaaaa.aaaaaaaa
another_fiiiiiiiiiiiiiiiiiiiiield = 2;
llvm-svn: 199796
|
|
|
|
|
|
|
|
|
|
| |
Before:
#if AAAA &&BBBB
After:
#if AAAA && BBBB
llvm-svn: 199713
|
|
|
|
|
|
|
|
|
|
| |
Before:
option(my_option) = "abc";
After:
option (my_option) = "abc";
llvm-svn: 199672
|
|
|
|
|
|
|
| |
As per the style guide, two lines are required between top-level
elements.
llvm-svn: 199660
|
|
|
|
|
|
|
|
|
| |
With this patch, there is dedicated testing for protocol buffers
(https://developers.google.com/protocol-buffers/).
Also some minor tweaks formatting tweaks.
llvm-svn: 199580
|
|
|
|
|
|
|
|
|
| |
Before:
foo (^{ bar(); });
After:
foo(^{ bar(); });
llvm-svn: 199573
|
|
|
|
|
|
|
|
|
| |
The author might be missing the "#" or these might be protocol buffer
definitions. Either way, we should not break the line or the string.
There don't seem to be other valid use cases.
llvm-svn: 199501
|
|
|
|
|
|
|
|
|
|
| |
Before:
int a = [operation block:^int(int * i) { return 1; }];
After:
int a = [operation block:^int(int *i) { return 1; }];
llvm-svn: 199411
|
|
|
|
|
|
|
|
|
| |
So clang-format can now format:
int c = []()->int { return 2; }();
int c = []()->vector<int> { return { 2 }; }();
llvm-svn: 199368
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var arr = [ 1, 2, 3 ];
var obj = {a : 1, b : 2, c : 3};
After:
var arr = [1, 2, 3];
var obj = {a: 1, b: 2, c: 3};
llvm-svn: 199317
|
|
|
|
|
|
|
|
|
|
|
|
| |
We cannot simply change the start column to accomodate for the @ in an
ObjC string literal as that will make clang-format happily violate the
column limit.
Use a different workaround instead. However, a better long-term
solution might be to join the @ and the rest of the literal into a
single token.
llvm-svn: 199198
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Formatting:
Constructor() :
// Comment forcing unwanted break.
aaaa(aaaa) {}
Before:
Constructor()
:
// Comment forcing unwanted break.
aaaa(aaaa) {}
After:
Constructor()
: // Comment forcing unwanted break.
aaaa(aaaa) {}
llvm-svn: 199107
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeThing // break
.SomeFunction( // break
param);
After:
SomeThing // break
.SomeFunction( // break
param);
Seems to be more common in editors and codebases I have looked at.
llvm-svn: 199105
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]
.insert(ccccccccccccccccccccccc);
After:
SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert(
ccccccccccccccccccccccc);
This seems to be about 3:1 more common in Google and Chromium style and I found
only a handful of instances inside the LLVM codebase.
llvm-svn: 198924
|
|
|
|
|
|
|
|
|
| |
Before:
[dictionary setObject:@(1)forKey:@"number"];
After:
[dictionary setObject:@(1) forKey:@"number"];
llvm-svn: 198920
|
|
|
|
|
|
|
|
| |
While it is allowed to not have an @ on subsequent lines, it seems
general practice to add them. If undesired, the code author can easily
remove them again and clang-format won't re-add them.
llvm-svn: 198871
|
|
|
|
|
|
|
|
|
| |
Before:
#pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
#pragma mark Any non-hyphenated or hyphenated string (including parentheses).
llvm-svn: 198870
|
|
|
|
|
|
|
|
|
| |
- Format a braced list with one element per line if it has nested
braced lists.
- Use a column layout only when the list has 6+ elements (instead of the
current 4+ elements).
llvm-svn: 198869
|
|
|
|
|
|
|
|
| |
@implementation block.
PR18406.
llvm-svn: 198770
|
|
|
|
|
|
|
|
|
|
| |
Before:
vector<int> foo{ ::SomeFunction()};
After:
vector<int> foo{::SomeFunction()};
llvm-svn: 198769
|
|
|
|
|
|
|
| |
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.
llvm-svn: 198686
|
|
|
|
|
|
|
|
|
|
| |
Before (in Google style):
enum ShortEnum {A, B, C};
After:
enum ShortEnum { A, B, C };
llvm-svn: 198559
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum ShortEnum {
A,
B,
C
};
After:
enum ShortEnum { A, B, C };
This seems to be the predominant choice in LLVM/Clang as well as in
Google style.
llvm-svn: 198558
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#define LIST(L) \
L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
L(FifthElement)
After:
#define LIST(L) \
L(FirstElement) \
L(SecondElement) \
L(ThirdElement) \
L(FourthElement) \
L(FifthElement)
llvm-svn: 198407
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Added CommentPragmas option for this.
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2460
llvm-svn: 198310
|
|
|
|
| |
llvm-svn: 198191
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaa =
1);
After:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
int aaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1);
llvm-svn: 198070
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Constructor() : a(a) {}
After:
Constructor()
: a(a)
{
}
This style guide is pretty precise about this.
llvm-svn: 197980
|
|
|
|
|
|
| |
Introduced in r197900.
llvm-svn: 197906
|
|
|
|
|
|
| |
Among other things, this fixes llvm.org/PR15269.
llvm-svn: 197900
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeFunction(L"A" L"B");
After:
SomeFunction(L"A"
L"B");
llvm-svn: 197785
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A comment following the "{" of a braced list seems to almost always
refer to the first element of the list and thus should be aligned
to it.
Before (with Cpp11 braced list style):
SomeFunction({ // Comment 1
"first entry",
// Comment 2
"second entry"});
After:
SomeFunction({// Comment 1
"first entry",
// Comment 2
"second entry"});
llvm-svn: 197725
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unexpectedly, it seems that people commonly know what they were doing
when writing a comment.
Also, being more conservative about comment breaking has the advantage
of giving more flexibility. If a linebreak within the comment can
improve formatting, the author can add it (after which clang-format
won't undo it). There is no way to override clang-format's behavior if
it breaks a comment.
llvm-svn: 197698
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaa);
After:
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaa);
llvm-svn: 197690
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();
After:
aaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();
Probably still not ideal, but should be a step into the right direction.
llvm-svn: 197557
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
bool a = ([aaaaaaaa aaaaa] == aaaaaaaaaaaaaaaaa || [aaaaaaaa aaaaa] ==
aaaaaaaaaaaaaaaaaaaa);
After:
bool a = ([aaaaaaaa aaaaa] == aaaaaaaaaaaaaaaaa ||
[aaaaaaaa aaaaa] == aaaaaaaaaaaaaaaaaaaa);
This fixes llvm.org/PR18271.
llvm-svn: 197552
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Formatting this:
void f() { // 1 space initial indent.
int i;
#define A \
int i; \
int j;
int k; // Format this line.
}
void f() {
#define A 1 // Format this line.
}
Before:
void f() { // 1 space initial indent.
int i;
#define A \
int i; \
int j;
int k; // Format this line.
}
void f() {
#define A 1 // Format this line.
}
After:
void f() { // 1 space initial indent.
int i;
#define A \
int i; \
int j;
int k; // Format this line.
}
void f() {
#define A 1 // Format this line.
}
llvm-svn: 197494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
virtual void aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa aaaa, aaaaaaaaaaa aaaaa) const
override;
virtual void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() const
override;
After:
virtual void aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa aaaa,
aaaaaaaaaaa aaaaa) const override;
virtual void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
const override;
llvm-svn: 197391
|
|
|
|
|
|
|
|
|
|
|
| |
BreakConstructorInitializersBeforeComma is true.
This option is used in WebKit style, so this also ensures initializer lists are
not put on a single line, as per the WebKit coding guidelines.
Patch by Florian Sowade!
llvm-svn: 197386
|
|
|
|
|
|
|
|
|
| |
Before:
void f() { typedef void (*f)(int * a); }
After:
void f() { typedef void (*f)(int *a); }
llvm-svn: 197369
|