refactor(dev-infra): fix lint warnings for Pullapprove-related scripts (#36287)

The `dev-infra` scripts were added to the list of sources that should be verified with clang (b07b6edc2a), but the Pullapprove-related scripts that were merged before (83e4a76afa) doesn't pass these checks. This commit updates a couple scripts to have a proper formatting.

PR Close #36287
This commit is contained in:
Andrew Kushnir 2020-03-27 18:14:52 -07:00 committed by Igor Minar
parent 5cee709266
commit c94a33c525
2 changed files with 13 additions and 8 deletions

View File

@ -72,13 +72,17 @@ export class PullApproveGroup {
} else if (condition.match(CONDITION_TYPES.ATTR_LENGTH)) {
// Currently a noop as we do not take any action on this condition type.
} else {
const errMessage = `Unrecognized condition found, unable to parse the following condition: \n\n` +
`From the [${groupName}] group:\n` +
` - ${condition}` +
`\n\n` +
`Known condition regexs:\n` +
`${Object.entries(CONDITION_TYPES).map(([k, v]) => ` ${k} - ${v}`).join('\n')}` +
`\n\n`;
const errMessage =
`Unrecognized condition found, unable to parse the following condition: \n\n` +
`From the [${groupName}] group:\n` +
` - ${condition}` +
`\n\n` +
`Known condition regexs:\n` +
`${Object.entries(CONDITION_TYPES).map(([k, v]) => ` ${k} - $ {
v
}
`).join('\n')}` +
`\n\n`;
console.error(errMessage);
process.exit(1);
}

View File

@ -9,10 +9,11 @@ import {readFileSync} from 'fs';
import * as path from 'path';
import {cd, exec, set} from 'shelljs';
import {getRepoBaseDir} from '../utils/config';
import {PullApproveGroup} from './group';
import {logGroup, logHeader} from './logging';
import {parsePullApproveYaml} from './parse-yaml';
import {getRepoBaseDir} from '../utils/config';
export function verify() {
// Exit early on shelljs errors