@mediamonks/commitlint-issue-reference
Version:
Ensures your commit messages always include the same issue key as in your branch name
23 lines (22 loc) • 875 B
TypeScript
export type IssueReferences = {
isFound: boolean;
foundMatches: Array<string>;
hasCorrectAmount: boolean;
hasCorrectFormat: boolean;
hasCorrectPosition: boolean | undefined;
hasCorrectLocation: boolean;
headerMatchResults: MatchResults;
footerMatchResults: MatchResults;
otherIssuesFound: boolean;
};
export type MatchResults = {
patternMatches: Array<string>;
branchIssueMatches: Array<string>;
branchIssue: string | undefined;
hasFoundIssue: boolean;
isCorrectIssueFormat: boolean;
otherIssuesFound: boolean;
anyIssuesFound: boolean;
};
export declare function findIssueReferencesInCommit(message: string, ticketInBranch: string, issuePattern: string, expectedLocation: 'header' | 'footer'): IssueReferences;
export declare function findMatches(message: string, pattern: RegExp, issue: string): MatchResults;