style(compiler-cli): reformat of codebase with new clang-format version (#36520)

This commit reformats the packages/compiler-cli tree using the new version
of clang-format.

PR Close #36520
This commit is contained in:
Alex Rickabaugh
2020-04-07 12:43:43 -07:00
committed by atscott
parent 717df13207
commit 0a69a2832b
205 changed files with 2949 additions and 2122 deletions

View File

@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AUTO_STYLE, animate, state, style, transition, trigger} from '@angular/animations';
import {animate, AUTO_STYLE, state, style, transition, trigger} from '@angular/animations';
import {Component} from '@angular/core';
@Component({
@ -30,8 +30,16 @@ import {Component} from '@angular/core';
})
export class AnimateCmp {
stateExpression: string;
constructor() { this.setAsClosed(); }
setAsSomethingElse() { this.stateExpression = 'something'; }
setAsOpen() { this.stateExpression = 'open'; }
setAsClosed() { this.stateExpression = 'closed'; }
constructor() {
this.setAsClosed();
}
setAsSomethingElse() {
this.stateExpression = 'something';
}
setAsOpen() {
this.stateExpression = 'open';
}
setAsClosed() {
this.stateExpression = 'closed';
}
}

View File

@ -8,6 +8,8 @@
import {InjectionToken} from '@angular/core';
export interface Named { name: string; }
export interface Named {
name: string;
}
export const CUSTOM = new InjectionToken<Named>('CUSTOM');

View File

@ -10,5 +10,7 @@ import {Component} from '@angular/core';
@Component({selector: 'comp-with-error', templateUrl: 'errors.html'})
export class BindingErrorComp {
createError() { throw new Error('Test'); }
createError() {
throw new Error('Test');
}
}

View File

@ -7,7 +7,7 @@
*/
import * as common from '@angular/common';
import {CUSTOM_ELEMENTS_SCHEMA, Component, Directive, EventEmitter, Inject, InjectionToken, NgModule, Output, forwardRef} from '@angular/core';
import {Component, CUSTOM_ELEMENTS_SCHEMA, Directive, EventEmitter, forwardRef, Inject, InjectionToken, NgModule, Output} from '@angular/core';
import {Observable} from 'rxjs';
import {wrapInArray} from './funcs';
@ -62,7 +62,9 @@ export class CompUsingCustomElements {
})
export class CompConsumingEvents {
handleDomEventVoid(e: any): void {}
handleDomEventPreventDefault(e: any): boolean { return false; }
handleDomEventPreventDefault(e: any): boolean {
return false;
}
handleDirEvent(e: any): void {}
}
@ -70,8 +72,7 @@ export class CompConsumingEvents {
selector: '[dirEvent]',
})
export class DirPublishingEvents {
@Output('dirEvent')
dirEvent: Observable<string> = new EventEmitter();
@Output('dirEvent') dirEvent: Observable<string> = new EventEmitter();
}
@NgModule({schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: wrapInArray(CompUsingCustomElements)})

View File

@ -11,7 +11,7 @@ import {Component, Directive, Injectable, NgModule, Pipe} from '@angular/core';
const instances = new Map<any, Base>();
export function expectInstanceCreated(type: any) {
const instance = instances.get(type) !;
const instance = instances.get(type)!;
expect(instance).toBeDefined();
expect(instance.dep instanceof SomeDep).toBe(true);
}
@ -19,7 +19,9 @@ export function expectInstanceCreated(type: any) {
export class SomeDep {}
export class Base {
constructor(public dep: SomeDep) { instances.set(Object.getPrototypeOf(this).constructor, this); }
constructor(public dep: SomeDep) {
instances.set(Object.getPrototypeOf(this).constructor, this);
}
}
@Component({templateUrl: './jit_summaries.html'})
@ -36,7 +38,9 @@ export class SomeDirective extends Base {
@Pipe({name: 'somePipe'})
export class SomePipe extends Base {
transform(value: any) { return value; }
transform(value: any) {
return value;
}
}
@Injectable()

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ApplicationRef, NgModule, forwardRef} from '@angular/core';
import {ApplicationRef, forwardRef, NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {ServerModule} from '@angular/platform-server';
import {FlatModule} from 'flat_module';

View File

@ -19,24 +19,26 @@ export class ServiceUsingLibModule {
@Directive({selector: '[someDir]', host: {'[title]': 'someDir'}})
export class SomeDirectiveInRootModule {
@Input()
someDir: string;
@Input() someDir: string;
}
@Directive({selector: '[someDir]', host: {'[title]': 'someDir'}})
export class SomeDirectiveInLibModule {
@Input()
someDir: string;
@Input() someDir: string;
}
@Pipe({name: 'somePipe'})
export class SomePipeInRootModule {
transform(value: string): any { return `transformed ${value}`; }
transform(value: string): any {
return `transformed ${value}`;
}
}
@Pipe({name: 'somePipe'})
export class SomePipeInLibModule {
transform(value: string): any { return `transformed ${value}`; }
transform(value: string): any {
return `transformed ${value}`;
}
}
@Component({selector: 'comp', template: `<div [someDir]="'someValue' | somePipe"></div>`})
@ -66,8 +68,8 @@ export class SomeLibModule {
return {
ngModule: SomeLibModule,
providers: [
ServiceUsingLibModule, provideValueWithEntryComponents(
[{a: 'b', component: CompUsingLibModuleDirectiveAndPipe}])
ServiceUsingLibModule,
provideValueWithEntryComponents([{a: 'b', component: CompUsingLibModuleDirectiveAndPipe}])
]
};
}