UNPKG

1.15 kBTypeScriptView Raw
1import { Severity } from "@atomist/automation-client/lib/operations/review/ReviewResult";
2import { PushTest } from "../../../api/mapping/PushTest";
3import { ReviewerRegistration } from "../../../api/registration/ReviewerRegistration";
4/**
5 * Antipattern we'll look for. Can be defined as a regex or a string.
6 */
7export interface AntiPattern {
8 name: string;
9 antiPattern: RegExp | string;
10 comment: string;
11}
12export interface PatternMatchReviewerOptions {
13 /**
14 * PushTest to narrow review applicability
15 */
16 pushTest?: PushTest;
17 /**
18 * Glob pattern for files to check
19 */
20 globPattern: string;
21 category?: string;
22 subcategory?: string;
23 severity?: Severity;
24}
25/**
26 * Return a ReviewerRegistration that objects to the given antipatterns and looks in the specified files
27 * @param {string} name
28 * @param opts targeting options
29 * @param {AntiPattern} antiPatterns
30 * @return {ReviewerRegistration}
31 */
32export declare function patternMatchReviewer(name: string, opts: PatternMatchReviewerOptions, ...antiPatterns: AntiPattern[]): ReviewerRegistration;
33//# sourceMappingURL=patternMatchReviewer.d.ts.map
\No newline at end of file