danger-plugin-pull-request
Version:
A Danger plugin to verify the completion of a pull request
60 lines (59 loc) • 2.63 kB
TypeScript
export declare function message(message: string): void;
export declare function warn(message: string): void;
export declare function fail(message: string): void;
export declare function markdown(message: string): void;
export declare type Reporter = (message: string) => void;
/**
* Checks if the pull request request has at least one assignee.
* @param reporter The reporter function if the check fails.
*/
export declare const checkAssignees: (reporter?: Reporter) => void;
/**
* Checks if the description of the PR is long enough.
* @param minimumLength The minimum length of the description.
* @param reporter The reporter function if the check fails.
*/
export declare const checkDescription: (minimumLength: number, reporter?: Reporter) => void;
/**
* Checks if the pull request title matches a given pattern.
* @param pattern The pattern to match.
* @param patternMessage readable pattern message for reporter message.
* @param reporter The reporter function if the check fails.
*/
export declare const checkTitle: (pattern: RegExp, patternMessage?: string | undefined, reporter?: Reporter) => void;
/**
* Checks if a pull request is too big.
* @param maxSize The maximum changed files count to be valid
* @param reporter The reporter function if the check fails.
*/
export declare const checkPRSize: (maxSize: number, reporter?: Reporter) => void;
/**
* Checks if merge squash checked. (GitLab only)
* @param reporter The reporter function if the check fails.
*/
export declare const checkMergeSquashChecked: (reporter?: Reporter) => void;
/**
* Checks if delete source branch checked. (GitLab only)
* @param reporter The reporter function if the check fails.
*/
export declare const checkDeleteSourceBranchChecked: (reporter?: Reporter) => void;
/**
* Github available plugins
*/
export declare const github: {
checkAssignees: (reporter?: Reporter) => void;
checkDescription: (minimumLength: number, reporter?: Reporter) => void;
checkTitle: (pattern: RegExp, patternMessage?: string | undefined, reporter?: Reporter) => void;
checkPRSize: (maxSize: number, reporter?: Reporter) => void;
};
/**
* GitLab available plugins
*/
export declare const gitlab: {
checkAssignees: (reporter?: Reporter) => void;
checkDescription: (minimumLength: number, reporter?: Reporter) => void;
checkTitle: (pattern: RegExp, patternMessage?: string | undefined, reporter?: Reporter) => void;
checkPRSize: (maxSize: number, reporter?: Reporter) => void;
checkMergeSquashChecked: (reporter?: Reporter) => void;
checkDeleteSourceBranchChecked: (reporter?: Reporter) => void;
};