| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Seems this isn't generally desirable.
Before:
int const * a;
After:
int const* a;
llvm-svn: 272548
|
|
|
|
|
|
|
|
|
|
| |
Before:
returnsFunction (¶m1, ¶m2)(param);
After:
returnsFunction(¶m1, ¶m2)(param);
llvm-svn: 272538
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before (when aligning & to the right):
SomeType MemberFunction(const Deleted &) const&;
After:
SomeType MemberFunction(const Deleted &) const &;
This also applies to variable declarations, e.g.:
int const * a;
However, this form is very uncommon (most people would write
"const int* a" instead) and contracting to "const*" might actually send
the wrong signal of what the const binds to.
llvm-svn: 272537
|
|
|
|
|
|
|
|
|
|
| |
Before:
auto s = sizeof...(Ts)-1;
After:
auto s = sizeof...(Ts) - 1;
llvm-svn: 272536
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D21204
llvm-svn: 272524
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This also fixes union type formatting in function parameter types.
Before: function x(path: number| string) {}
After: function x(path: number|string) {}
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21206
llvm-svn: 272330
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.. and simplify it.
Before:
void A::f()&& {}
void f() && {}
After:
void A::f() && {}
void f() && {}
llvm-svn: 272124
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Shebang lines (`#!/bin/blah`) can be used in JavaScript scripts to indicate
they should be run using e.g. node. This change treats # lines on the first line
as line comments.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20632
llvm-svn: 271185
|
|
|
|
|
|
|
| |
While it might change the meaning of the comment in rare circumstances,
it is better than violating the column limit.
llvm-svn: 270975
|
|
|
|
|
|
|
|
| |
Otherwise, clang-format can get confused with statements like:
x.for = 1;
llvm-svn: 270188
|
|
|
|
|
|
|
|
|
|
| |
Before:
const[a, b, c] = [1, 2, 3];
After:
const [a, b, c] = [1, 2, 3];
llvm-svn: 270029
|
|
|
|
|
|
|
|
|
|
| |
Before:
case a... b: break;
After:
case a ... b: break;
llvm-svn: 270027
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
colon in constructor initializer.
Summary: Make clang-format cleaner remove redundant commas/colons in constructor initializer list.
Reviewers: klimek, djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19804
llvm-svn: 269888
|
|
|
|
|
|
|
|
|
|
| |
Before:
f(/*a=*/a, /*b=*/ ::b);
After:
f(/*a=*/a, /*b=*/::b);
llvm-svn: 268879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async functions are not quite in the spec yet, but stage 3 and already widely used:
http://tc39.github.io/ecmascript-asyncawait/
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D19204
llvm-svn: 267368
|
|
|
|
|
|
|
| |
Specifically understand ellipses in parameter lists and treat trailing
reference qualifiers and the "{" as signals.
llvm-svn: 266599
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
MACRO(
abc).function() // wrap
<< abc;
After:
MACRO(abc).function() // wrap
<< abc;
llvm-svn: 265540
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
auto x = (X) this;
After:
auto x = (X)this;
This fixes llvm.org/PR27198.
llvm-svn: 265385
|
|
|
|
|
|
|
|
|
| |
"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.
Patch by Martin Probst.
llvm-svn: 264055
|
|
|
|
|
|
|
|
|
| |
The operators | and & in types, as opposed to the bitwise operators,
should not have whitespace around them (e.g. `Foo<Bar|Baz>`).
Patch by Martin Probst. Thank you.
llvm-svn: 263961
|
|
|
|
|
|
|
|
|
|
| |
Before:
x.of ();
After:
x.of();
llvm-svn: 263710
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow the Google JavaScript style
guide:
https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings
This functionality is behind the option "JavaScriptQuotes", which can be:
* "leave" (no re-quoting)
* "single" (change to single quotes)
* "double" (change to double quotes)
This also changes single quoted JavaScript string literals to be treated
as tok::string_literal, not tok::char_literal, which fixes two unrelated
tests.
Patch by Martin Probst. Thank you.
llvm-svn: 262534
|
|
|
|
|
|
| |
Patch by Erik Kessler, thank you.
llvm-svn: 262402
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa]
[a].aaaaaaaaaaaaaaaaaaaaaa();
After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a]
.aaaaaaaaaaaaaaaaaaaaaa();
llvm-svn: 262292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var x = {
a: a,
b: b, 'c': c,
};
After:
var x = {
a: a,
b: b,
'c': c,
};
llvm-svn: 262291
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 261528
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (var i of[2, 3]) {}
After:
for (var i of [2, 3]) {}
llvm-svn: 260518
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, make it more expensive than breaking after the return
type of a function definition/declaration.
Before:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
After:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
llvm-svn: 260497
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
f({a},
() => {
g(); //
});
After:
f({a}, () => {
g(); //
});
llvm-svn: 260060
|
|
|
|
|
|
|
|
|
|
| |
Before:
f(a.operator() < A > ());
After:
f(a.operator()<A>());
llvm-svn: 259884
|
|
|
|
|
|
|
|
|
|
|
|
| |
initializers.
Before:
Constructor() : member([](A *a, B * b) {}) {}
After:
Constructor() : member([](A *a, B *b) {}) {}
llvm-svn: 259353
|
|
|
|
| |
llvm-svn: 259350
|
|
|
|
|
|
|
|
|
|
| |
Before:
a[ ::b::c];
After:
a[::b::c];
llvm-svn: 258123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang-format only works for JavaScript code, if all the semicolons are
present anyway, so this linebreak can never be desired.
Before (with appropriate statement lengths or column limit):
return
[ aaa ];
After:
return [
aaaa
];
llvm-svn: 257741
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaa operator,(aaaaaaaaaaaaaaaaaaaaa &
aaaaaaaaaaaaaaaaaaaaaaaaaa) const;
After:
aaaaaaaaaaaaaaaaaaaaaa operator,(
aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaaaaaaaaaaaaaaaaaaa) const;
llvm-svn: 257330
|
|
|
|
|
|
|
|
|
|
| |
Before:
bool operator, ();
After:
bool operator,();
llvm-svn: 257256
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
over wrapping before parameters.
Before:
function someFunc(
args: string[]): {longReturnValue: string[]} {}
After:
function someFunc(args: string[]):
{longReturnValue: string[]} {}
llvm-svn: 257162
|
|
|
|
|
|
|
|
|
|
| |
Before:
MACRO((AA & a) { return 1; });
After:
MACRO((AA &a) { return 1; });
llvm-svn: 257062
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r256750 has been leading to an undesired behavior:
aaaaaaaaaa
.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
This change increases penalty for wrapping before member accesses that aren't
calls. Thus, this is again formatted as (as it has been before r256750):
aaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 256830
|
|
|
|
| |
llvm-svn: 256759
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
export default[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb];
export default[];
After:
export default [
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
];
export default [];
llvm-svn: 256758
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the [] in the following example were recognized as an array
subscript leading to weird indentation.
Before:
var aaaa = aaaaa || // wrap
[];
After:
var aaaa = aaaaa || // wrap
[];
llvm-svn: 256753
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
return aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaa)
.aaaa(aaaaaaaaaaaaaa);
After:
return aaaaaaaaaaaaaaaa
.aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa)
.aaaa(aaaaaaaaaaaaaa);
llvm-svn: 256750
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
std::function<std::string(const std::string &)> my_lambda = [](
const string &s) { return s; };
After:
std::function<std::string(const std::string &)> my_lambda =
[](const string &s) { return s; };
llvm-svn: 256739
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
- (void)shortf:(GTMFoo *)theFoo
longKeyword:(NSRect)theRect
longerKeyword:(float)theInterval
error:(NSError **)theError {
}
After:
- (void)shortf:(GTMFoo *)theFoo
longKeyword:(NSRect)theRect
longerKeyword:(float)theInterval
error:(NSError **)theError {
}
llvm-svn: 256738
|
|
|
|
| |
llvm-svn: 256737
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional AAA aaa = 1 [foo =
{
key: "a" //
},
bar = {
key: "a" //
}];
After:
optional AAA aaa = 1 [
foo = {
key: "a" //
},
bar = {
key: "a" //
}
];
llvm-svn: 256736
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
breaking between array subscripts.
Before:
if (aaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaa]
[aaaaaaaaaaaaa])
After:
if (aaaaaaaaaaaaaaaaaaaaaaaa &&
aaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaa][aaaaaaaaaaaaa])
llvm-svn: 256640
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
function foo(check: Object): check
is{foo: string, bar: string, baz: string, foobar: string} {
return 'bar' in check;
}
After:
function foo(check: Object):
check is {foo: string, bar: string, baz: string, foobar: string} {
return 'bar' in check;
}
llvm-svn: 256631
|
|
|
|
|
|
|
|
|
|
| |
Before:
int x = f (&h)();
After:
int x = f(&h)();
llvm-svn: 256488
|