style(dev-infra): correct tslint failures in dev-infra directory (#37233)

Fixes tslint failures in dev-infra directory as the directory is now
part of the tslint enforced files.

PR Close #37233
This commit is contained in:
Joey Perrott 2020-05-20 16:04:46 -07:00 committed by atscott
parent 753fed285c
commit 4e7a4543b8
11 changed files with 35 additions and 15 deletions

View File

@ -36,7 +36,7 @@ exports.config = {
showColors: true, showColors: true,
defaultTimeoutInterval: 90000, defaultTimeoutInterval: 90000,
print: function(msg) { print: function(msg) {
console.log(msg); console.info(msg);
}, },
}, },
useAllAngular2AppRoots: true useAllAngular2AppRoots: true

View File

@ -1,6 +1,6 @@
/** /**
* @license * @license
* Copyright Google Inc. All Rights Reserved. * Copyright Google LLC All Rights Reserved.
* *
* Use of this source code is governed by an MIT-style license that can be * 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 * found in the LICENSE file at https://angular.io/license

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* 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 {Arguments, Argv} from 'yargs'; import {Arguments, Argv} from 'yargs';
import {error} from '../../utils/console'; import {error} from '../../utils/console';

View File

@ -17,7 +17,7 @@ export function buildMergeCommand(yargs: Argv) {
return yargs.help().strict().option('github-token', { return yargs.help().strict().option('github-token', {
type: 'string', type: 'string',
description: 'Github token. If not set, token is retrieved from the environment variables.' description: 'Github token. If not set, token is retrieved from the environment variables.'
}) });
} }
/** Handles the merge command. i.e. performs the merge of a specified pull request. */ /** Handles the merge command. i.e. performs the merge of a specified pull request. */

View File

@ -38,7 +38,7 @@ export interface MergeRemote {
/** Name of the repository. */ /** Name of the repository. */
name: string; name: string;
/** Whether SSH should be used for merging pull requests. */ /** Whether SSH should be used for merging pull requests. */
useSsh?: boolean useSsh?: boolean;
} }
/** /**
@ -87,15 +87,11 @@ export function loadAndValidateConfig(): {config?: MergeConfigWithRemote, errors
const config: Partial<DevInfraMergeConfig> = getConfig(); const config: Partial<DevInfraMergeConfig> = getConfig();
if (config.merge === undefined) { if (config.merge === undefined) {
return { return {errors: ['No merge configuration found. Set the `merge` configuration.']};
errors: ['No merge configuration found. Set the `merge` configuration.']
}
} }
if (typeof config.merge !== 'function') { if (typeof config.merge !== 'function') {
return { return {errors: ['Expected merge configuration to be defined lazily through a function.']};
errors: ['Expected merge configuration to be defined lazily through a function.']
}
} }
const mergeConfig = config.merge(); const mergeConfig = config.merge();

View File

@ -153,7 +153,7 @@ export class GithubApiMergeStrategy extends MergeStrategy {
* strategy, we cannot start an interactive rebase because we merge using the Github API. * strategy, we cannot start an interactive rebase because we merge using the Github API.
* The Github API only allows modifications to PR title and body for squash merges. * The Github API only allows modifications to PR title and body for squash merges.
*/ */
async _promptCommitMessageEdit(pullRequest: PullRequest, mergeOptions: PullsMergeParams) { private async _promptCommitMessageEdit(pullRequest: PullRequest, mergeOptions: PullsMergeParams) {
const commitMessage = await this._getDefaultSquashCommitMessage(pullRequest); const commitMessage = await this._getDefaultSquashCommitMessage(pullRequest);
const {result} = await prompt<{result: string}>({ const {result} = await prompt<{result: string}>({
type: 'editor', type: 'editor',

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* 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 {join} from 'path'; import {join} from 'path';
import {PullRequestFailure} from '../failures'; import {PullRequestFailure} from '../failures';
import {PullRequest} from '../pull-request'; import {PullRequest} from '../pull-request';

View File

@ -1,4 +1,11 @@
#!/usr/bin/env node #!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* 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
*/
/** /**
* Script that can be passed as commit message filter to `git filter-branch --msg-filter`. * Script that can be passed as commit message filter to `git filter-branch --msg-filter`.

View File

@ -20,7 +20,7 @@ export interface CircularDependenciesTestConfig {
/** Path to the golden file that is used for checking and approving. */ /** Path to the golden file that is used for checking and approving. */
goldenFile: string; goldenFile: string;
/** Glob that resolves source files which should be checked. */ /** Glob that resolves source files which should be checked. */
glob: string glob: string;
/** /**
* Optional module resolver function that can be used to resolve modules * Optional module resolver function that can be used to resolve modules
* to absolute file paths. * to absolute file paths.

View File

@ -28,7 +28,7 @@ const graphql = unauthenticatedGraphql.defaults({
/** Get a PR from github */ /** Get a PR from github */
export async function getPr<PrSchema>( export async function getPr<PrSchema>(
prSchema: PrSchema, number: number, {owner, name}: GithubConfig) { prSchema: PrSchema, prNumber: number, {owner, name}: GithubConfig) {
const PR_QUERY = params( const PR_QUERY = params(
{ {
$number: 'Int!', // The PR number $number: 'Int!', // The PR number
@ -41,7 +41,8 @@ export async function getPr<PrSchema>(
}) })
}); });
const result = await graphql(graphqlQuery(PR_QUERY), {number, owner, name}) as typeof PR_QUERY; const result =
await graphql(graphqlQuery(PR_QUERY), {number: prNumber, owner, name}) as typeof PR_QUERY;
return result.repository.pullRequest; return result.repository.pullRequest;
} }

View File

@ -1,6 +1,6 @@
/** /**
* @license * @license
* Copyright Google Inc. All Rights Reserved. * Copyright Google LLC All Rights Reserved.
* *
* Use of this source code is governed by an MIT-style license that can be * 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 * found in the LICENSE file at https://angular.io/license