Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 1f3ab48

Browse files
hzoopetebacondarwin
authored andcommitted
style(*): add jscs rule disallowSpacesInCallExpression
Closes #10772
1 parent d9498a1 commit 1f3ab48

File tree

6 files changed

+20
-28
lines changed

6 files changed

+20
-28
lines changed

.jscs.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"disallowSpacesInAnonymousFunctionExpression": {
1313
"beforeOpeningRoundBrace": true
1414
},
15+
"disallowSpacesInCallExpression": true,
1516
"disallowSpacesInFunctionDeclaration": {
1617
"beforeOpeningRoundBrace": true
1718
},

test/auto/injectorSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ describe('strict-di injector', function() {
976976
});
977977
});
978978
inject(function($injector) {
979-
expect (function() {
979+
expect(function() {
980980
$injector.invoke(function($test2) {});
981981
}).toThrowMinErr('$injector', 'strictdi');
982982
});
@@ -990,7 +990,7 @@ describe('strict-di injector', function() {
990990
});
991991
});
992992
inject(function($injector) {
993-
expect (function() {
993+
expect(function() {
994994
$injector.invoke(['$test', function($test) {}]);
995995
}).toThrowMinErr('$injector', 'strictdi');
996996
});

test/ng/browserSpecs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ describe('browser', function() {
395395
});
396396

397397

398-
it ('should return a value for an existing cookie', function() {
398+
it('should return a value for an existing cookie', function() {
399399
document.cookie = "foo=bar=baz;path=/";
400400
expect(browser.cookies().foo).toEqual('bar=baz');
401401
});
@@ -408,7 +408,7 @@ describe('browser', function() {
408408
expect(browser.cookies()['foo']).toBe('"first"');
409409
});
410410

411-
it ('should decode cookie values that were encoded by puts', function() {
411+
it('should decode cookie values that were encoded by puts', function() {
412412
document.cookie = "cookie2%3Dbar%3Bbaz=val%3Due;path=/";
413413
expect(browser.cookies()['cookie2=bar;baz']).toEqual('val=ue');
414414
});

test/ng/compileSpec.js

+9-18
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,7 @@ describe('$compile', function() {
423423
describe('multiple directives per element', function() {
424424
it('should allow multiple directives per element', inject(function($compile, $rootScope, log) {
425425
element = $compile(
426-
'<span greet="angular" log="L" x-high-log="H" data-medium-log="M"></span>')
427-
($rootScope);
426+
'<span greet="angular" log="L" x-high-log="H" data-medium-log="M"></span>')($rootScope);
428427
expect(element.text()).toEqual('Hello angular');
429428
expect(log).toEqual('L; M; H');
430429
}));
@@ -607,8 +606,7 @@ describe('$compile', function() {
607606
describe('priority', function() {
608607
it('should honor priority', inject(function($compile, $rootScope, log) {
609608
element = $compile(
610-
'<span log="L" x-high-log="H" data-medium-log="M"></span>')
611-
($rootScope);
609+
'<span log="L" x-high-log="H" data-medium-log="M"></span>')($rootScope);
612610
expect(log).toEqual('L; M; H');
613611
}));
614612
});
@@ -809,17 +807,15 @@ describe('$compile', function() {
809807

810808

811809
it('should compile template when replacing', inject(function($compile, $rootScope, log) {
812-
element = $compile('<div><div replace medium-log>ignore</div><div>')
813-
($rootScope);
810+
element = $compile('<div><div replace medium-log>ignore</div><div>')($rootScope);
814811
$rootScope.$digest();
815812
expect(element.text()).toEqual('Replace!');
816813
expect(log).toEqual('LOG; HIGH; MEDIUM');
817814
}));
818815

819816

820817
it('should compile template when appending', inject(function($compile, $rootScope, log) {
821-
element = $compile('<div><div append medium-log>ignore</div><div>')
822-
($rootScope);
818+
element = $compile('<div><div append medium-log>ignore</div><div>')($rootScope);
823819
$rootScope.$digest();
824820
expect(element.text()).toEqual('Append!');
825821
expect(log).toEqual('LOG; HIGH; MEDIUM');
@@ -828,8 +824,7 @@ describe('$compile', function() {
828824

829825
it('should merge attributes including style attr', inject(function($compile, $rootScope) {
830826
element = $compile(
831-
'<div><div replace class="medium-log" style="height: 20px" ></div><div>')
832-
($rootScope);
827+
'<div><div replace class="medium-log" style="height: 20px" ></div><div>')($rootScope);
833828
var div = element.find('div');
834829
expect(div.hasClass('medium-log')).toBe(true);
835830
expect(div.hasClass('log')).toBe(true);
@@ -841,8 +836,7 @@ describe('$compile', function() {
841836

842837
it('should not merge attributes if they are the same', inject(function($compile, $rootScope) {
843838
element = $compile(
844-
'<div><div nomerge class="medium-log" id="myid"></div><div>')
845-
($rootScope);
839+
'<div><div nomerge class="medium-log" id="myid"></div><div>')($rootScope);
846840
var div = element.find('div');
847841
expect(div.hasClass('medium-log')).toBe(true);
848842
expect(div.hasClass('log')).toBe(true);
@@ -4892,8 +4886,7 @@ describe('$compile', function() {
48924886
});
48934887
});
48944888
inject(function(log, $rootScope, $compile) {
4895-
element = $compile('<div><div trans>T:{{x}}-{{$parent.$id}}-{{$id}}<span>;</span></div></div>')
4896-
($rootScope);
4889+
element = $compile('<div><div trans>T:{{x}}-{{$parent.$id}}-{{$id}}<span>;</span></div></div>')($rootScope);
48974890
$rootScope.x = 'root';
48984891
$rootScope.$apply();
48994892
expect(element.text()).toEqual('W:iso-1-2;T:root-2-3;');
@@ -5178,8 +5171,7 @@ describe('$compile', function() {
51785171
});
51795172
});
51805173
inject(function(log, $rootScope, $compile) {
5181-
element = $compile('<div><div trans>T:{{$$transcluded}}</div></div>')
5182-
($rootScope);
5174+
element = $compile('<div><div trans>T:{{$$transcluded}}</div></div>')($rootScope);
51835175
$rootScope.$apply();
51845176
expect(jqLite(element.find('span')[0]).text()).toEqual('I:');
51855177
expect(jqLite(element.find('span')[1]).text()).toEqual('T:true');
@@ -6010,8 +6002,7 @@ describe('$compile', function() {
60106002
});
60116003
});
60126004
inject(function(log, $rootScope, $compile) {
6013-
element = $compile('<div><div high-log trans="text" log>{{$parent.$id}}-{{$id}};</div></div>')
6014-
($rootScope);
6005+
element = $compile('<div><div high-log trans="text" log>{{$parent.$id}}-{{$id}};</div></div>')($rootScope);
60156006
$rootScope.$apply();
60166007
expect(log).toEqual('compile: <!-- trans: text -->; link; LOG; LOG; HIGH');
60176008
expect(element.text()).toEqual('1-2;1-3;');

test/ng/locationSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ describe('$location', function() {
13231323
});
13241324

13251325

1326-
it ('should not rewrite links when rewriting links is disabled', function() {
1326+
it('should not rewrite links when rewriting links is disabled', function() {
13271327
configureService({linkHref: 'link?a#b', html5Mode: {enabled: true, rewriteLinks:false}, supportHist: true});
13281328
inject(
13291329
initBrowser(),
@@ -1860,7 +1860,7 @@ describe('$location', function() {
18601860
})
18611861
);
18621862

1863-
it ('should fire $locationChangeSuccess event when change from browser location bar',
1863+
it('should fire $locationChangeSuccess event when change from browser location bar',
18641864
inject(function($log, $location, $browser, $rootScope) {
18651865
$rootScope.$apply(); // clear initial $locationChangeStart
18661866

test/ngMock/angular-mocksSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ describe('ngMock', function() {
12261226
});
12271227

12281228

1229-
it ('should throw exception when only headers differs from expectation', function() {
1229+
it('should throw exception when only headers differs from expectation', function() {
12301230
hb.when('GET').respond(200, '', {});
12311231
hb.expect('GET', '/match', undefined, {'Content-Type': 'application/json'});
12321232

@@ -1237,7 +1237,7 @@ describe('ngMock', function() {
12371237
});
12381238

12391239

1240-
it ('should throw exception when only data differs from expectation', function() {
1240+
it('should throw exception when only data differs from expectation', function() {
12411241
hb.when('GET').respond(200, '', {});
12421242
hb.expect('GET', '/match', 'some-data');
12431243

@@ -1248,7 +1248,7 @@ describe('ngMock', function() {
12481248
});
12491249

12501250

1251-
it ('should not throw an exception when parsed body is equal to expected body object', function() {
1251+
it('should not throw an exception when parsed body is equal to expected body object', function() {
12521252
hb.when('GET').respond(200, '', {});
12531253

12541254
hb.expect('GET', '/match', {a: 1, b: 2});
@@ -1263,7 +1263,7 @@ describe('ngMock', function() {
12631263
});
12641264

12651265

1266-
it ('should throw exception when only parsed body differs from expected body object', function() {
1266+
it('should throw exception when only parsed body differs from expected body object', function() {
12671267
hb.when('GET').respond(200, '', {});
12681268
hb.expect('GET', '/match', {a: 1, b: 2});
12691269

0 commit comments

Comments
 (0)