File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1037,7 +1037,7 @@ export class CIHelper {
10371037
10381038 if ( result ) {
10391039 const results = commits . map ( ( commit : IPRCommit ) => {
1040- const linter = new LintCommit ( commit ) ;
1040+ const linter = new LintCommit ( commit , this . config . lint . commitLintOptions ) ;
10411041 return linter . lint ( ) ;
10421042 } ) ;
10431043
Original file line number Diff line number Diff line change 11import { IPRCommit } from "./github-glue.js" ;
2+ import { ILintCommitConfig } from "./project-config.js" ;
23
34export interface ILintError {
45 checkFailed : boolean ; // true if check failed
56 message : string ;
67}
78
8- export interface ILintOptions {
9- maxColumns ?: number | undefined ; // max line length
10- }
11-
129/*
1310 * Simple single use class to drive lint tests on commit messages.
1411 */
@@ -19,7 +16,7 @@ export class LintCommit {
1916 private messages : string [ ] = [ ] ;
2017 private maxColumns = 76 ;
2118
22- public constructor ( patch : IPRCommit , options ?: ILintOptions ) {
19+ public constructor ( patch : IPRCommit , options ?: ILintCommitConfig ) {
2320 this . blocked = false ;
2421 this . lines = patch . message . split ( "\n" ) ;
2522 this . patch = patch ;
Original file line number Diff line number Diff line change @@ -48,9 +48,14 @@ export interface IAppConfig {
4848 altname : string | undefined ; // is this even needed?
4949}
5050
51+ export interface ILintCommitConfig {
52+ maxColumns ?: number | undefined ; // max line length
53+ }
54+
5155export interface ILintConfig {
5256 maxCommitsIgnore ?: string [ ] ; // array of pull request urls to skip check
5357 maxCommits : number ; // limit on number of commits in a pull request
58+ commitLintOptions ?: ILintCommitConfig ; // options to pass to commit linter
5459}
5560
5661export interface IUserConfig {
Original file line number Diff line number Diff line change 11import { expect , jest , test } from "@jest/globals" ;
2- import { ILintError , ILintOptions , LintCommit } from "../lib/commit-lint.js" ;
2+ import { ILintError , LintCommit } from "../lib/commit-lint.js" ;
33import { IPRCommit } from "../lib/github-glue.js" ;
4+ import { ILintCommitConfig } from "../lib/project-config.js" ;
45
56jest . setTimeout ( 180000 ) ;
67
@@ -15,7 +16,7 @@ jest.setTimeout(180000);
1516 * @param check a function to verify the lint result
1617 * @param options extra linter options, if any
1718 */
18- function lintCheck ( commit : IPRCommit , check ?: ( error : ILintError ) => void , options ?: ILintOptions ) {
19+ function lintCheck ( commit : IPRCommit , check ?: ( error : ILintError ) => void , options ?: ILintCommitConfig ) {
1920 const linter = new LintCommit ( commit , options ) ;
2021 const lintError = linter . lint ( ) ;
2122 if ( ! check ) {
You can’t perform that action at this time.
0 commit comments