| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
functions only
Differential Revision: http://reviews.llvm.org/D10774
llvm-svn: 240959
|
|
|
|
|
|
|
|
| |
Summary: This makes the Mozilla style defaults more compliant with the Mozilla style guide. A few options were removed in order to use the LLVM style defaults.
Differential Revision: http://reviews.llvm.org/D10771
llvm-svn: 240957
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);
After:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);
llvm-svn: 240934
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Depends on D10785.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D10786
llvm-svn: 240909
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D10784
llvm-svn: 240907
|
|
|
|
|
|
|
|
|
|
| |
Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.
Patch from Strager Neds!
http://reviews.llvm.org/D10372
llvm-svn: 240896
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional string operator= 1;
After:
optional string operator = 1;
llvm-svn: 240624
|
|
|
|
| |
llvm-svn: 240548
|
|
|
|
| |
llvm-svn: 240353
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch is generated using this command:
$ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
-checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
work/llvm/tools/clang
To reduce churn, not touching namespaces spanning less than 10 lines.
llvm-svn: 240270
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
conservative.
In particular, this fixes an unwanted corner case.
Before:
string s =
someFunction("aaaa"
"bbbb");
After:
string s = someFunction(
"aaaa"
"bbbb");
llvm-svn: 240129
|
|
|
|
|
|
|
| |
The previous one (r240021) regressed:
enum E Type::f() { .. }
llvm-svn: 240127
|
|
|
|
| |
llvm-svn: 240110
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was a bit too aggressive.
With this patch, we keep on breaking here:
aaaaaaaaaaaaa(aaaaaaa,
"aaaaaaa"
"bbbbbbb");
But don't break in:
aaaaaaaaaaaaa(aaaaaaa, aaaaaaaa("aaaaaaa"
"bbbbbbb"));
llvm-svn: 240024
|
|
|
|
|
|
|
|
|
| |
Before, this wasn't formatted properly:
enum ::C f() {
return a;
}
llvm-svn: 240021
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var func =
function() {
doSomething();
};
After:
var func =
function() {
doSomething();
};
This is a very narrow special case which fixes most of the discrepency
with what our users do. In the long run, we should try to come up with
a more generic fix for indenting these.
llvm-svn: 240014
|
|
|
|
|
|
| |
is().
llvm-svn: 240008
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 239903
|
|
|
|
|
|
| |
Patch by Mathieu Champlon. Thank you.
llvm-svn: 239900
|
|
|
|
|
|
|
|
|
|
|
| |
This makes this consistent with non-typescript enums.
Also shuffle the language-dependent stuff in mustBreakBefore to a
single location.
Patch initiated by Martin Probst.
llvm-svn: 239894
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Martin Probst.
Before:
enum {
A,
B
} var x = 1;
After:
enum {
A,
B
}
var x = 1;
llvm-svn: 239893
|
|
|
|
|
|
|
| |
starts with a given sequence of tokens. Only the one-token version is
used yet, but other usages are coming up momentarily.
llvm-svn: 239892
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var someVariable = SomeFuntion(aaaa, [
aaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbb,
ccccccccccccccccccccccccccc
],
aaaa);
After:
var someVariable = SomeFuntion(aaaa,
[
aaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbb,
ccccccccccccccccccccccccccc
],
aaaa);
llvm-svn: 239722
|
|
|
|
|
|
|
|
|
|
| |
Before, these would not properly detected because of the char/string
literal found when re-lexing after the first `:
var x = `'`; // comment with matching quote '
var x = `"`; // comment with matching quote "
llvm-svn: 239693
|
|
|
|
|
|
| |
Sadly C++11 doesn't let us use initializers on bitfield members (DR1341). NFC.
llvm-svn: 239606
|
|
|
|
|
|
| |
sizeof(ParenState) goes from 64 bytes to 52 bytes. NFC.
llvm-svn: 239605
|
|
|
|
| |
llvm-svn: 239604
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int c = []() -> int *{ return 2; }();
After:
int c = []() -> int * { return 2; }();
Based on patch by James Dennett (http://reviews.llvm.org/D10410), thank you!
llvm-svn: 239600
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
case (my_int) ONE:
After:
case (my_int)ONE:
This fixed llvm.org/PR23760
llvm-svn: 239597
|
|
|
|
| |
llvm-svn: 239595
|
|
|
|
|
|
|
|
|
|
| |
Without it, it would do:
interface I {
x: string;
} var y;
llvm-svn: 239593
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
statement.
When an exported function would follow a class declaration, it would not
be recognized as a stand-alone function. That would then collapse the
following line with the current one, e.g.
class C {}
export function f() {} var x;
llvm-svn: 239592
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
And fix formatting issue discovered by that :-).
llvm-svn: 239530
|
|
|
|
|
|
|
|
|
|
|
| |
The following example used to crash clang-format.
#define a\
/**/}
Adjusting the indentation level cache for the line starting with the
comment would lead to an out-of-bounds array read.
llvm-svn: 239521
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before clang-format would e.g. add a space into
#define Q_FOREACH(x, y)
which turns this into a non-function-like macro.
Patch by Strager Neds, thank you!
llvm-svn: 239513
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
assignments as enums.
Top level object literals are treated as enums, and their k/v pairs are put on
separate lines:
X.Y = {
A: 1,
B: 2
};
However assignments within blocks should not be affected:
function x() {
y = {a:1, b:2};
}
This change fixes the second case. Patch by Martin Probst.
llvm-svn: 239462
|
|
|
|
| |
llvm-svn: 239404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I have not succeeded in writing a proper test case for this yet and we
also need to solve the underlying fundamental problem of trying too
many combinations with nested blocks (basically this somewhat works
around our Dijkstra algorithm). Preventing this linebreak is good
anyways as usually the penalties never make us choose it (that's why I
can't create a test) and it also looks ugly.
Also cleaned up state comparison code that I discovered while hunting
this down.
llvm-svn: 239398
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
template <typename T>
auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
.aaaaaaaa());
After:
template <typename T>
auto aaaaaaaaaaaaaaaaaaaaaa(T t)
-> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());
Also add a test case for a difficult template parsing case I stumbled accross.
Needs fixing.
llvm-svn: 239149
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a more correct representation than using "Equality" introduced
in r238942 which was a quick fix to solve an actual regression.
According to the typescript spec, arrows behave like "low-precedence"
assignments.
Before:
var a = a.aaaaaaa((a: a) => aaaaaaaaaaaaaaaaaaaaa(bbbbbbbbb) &&
aaaaaaaaaaaaaaaaaaaaa(bbbbbbb));
After:
var a = a.aaaaaaa((a: a) => aaaaaaaaaaaaaaaaaaaaa(bbbbbbbbb) &&
aaaaaaaaaaaaaaaaaaaaa(bbbbbbb));
llvm-svn: 239137
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression in literal formatting:
Before:
aaaaaaaaaaaaa = {
aaaaaaaaaaaaaaaaaaaaaaaaaaaa: (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) =>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
};
After:
var aaaaaaaaaaaaaaaaaaaa = {
aaaaaaaaaaaaaaaaaaaaaaaaaaaa:
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) =>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
};
Also apply no-else-after-return policy.
llvm-svn: 238942
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
operators to the new line.
Before:
LOG_IF(aaa == //
bbb)
<< a
<< b;
After:
LOG_IF(aaa == //
bbb)
<< a << b;
llvm-svn: 238911
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var aaaaa: List<SomeThing> = [
new SomeThingAAAAAAAAAAAA(),
new SomeThingBBBBBBBBB()
];
After:
var aaaaa: List<SomeThing> =
[new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];
llvm-svn: 238909
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, this couldn't be formatted at all:
class X {
subs = {
'b': {
'c': 1,
},
};
}
llvm-svn: 238907
|
|
|
|
|
|
|
|
|
|
| |
Before:
return () =>[];
After:
return () => [];
llvm-svn: 238875
|
|
|
|
| |
llvm-svn: 238873
|
|
|
|
| |
llvm-svn: 238845
|
|
|
|
| |
llvm-svn: 238841
|