@@ -16,9 +16,9 @@ type GetCommitOptions = {
16
16
17
17
export type CommitLogObject = { [ position : string ] : string [ ] } ;
18
18
19
-
20
-
21
- export function parseCommits ( logs : ListLogSummary < any > ) : { [ hash : string ] : string [ ] } {
19
+ export function parseCommits (
20
+ logs : ListLogSummary < any >
21
+ ) : { [ hash : string ] : string [ ] } {
22
22
// Filter relevant logs
23
23
const commits : CommitLogObject = { } ;
24
24
const positions : string [ ] = [ ] ;
@@ -30,31 +30,31 @@ export function parseCommits(logs: ListLogSummary<any>): { [hash: string]: strin
30
30
31
31
if ( matches && matches . length ) {
32
32
// Use an object of commit arrays to collect all commits
33
- const { groups } = matches
34
- let position
33
+ const { groups } = matches ;
34
+ let position ;
35
35
if ( groups . init ) {
36
- position = ' INIT'
36
+ position = " INIT" ;
37
37
} else if ( groups . levelId && groups . stepId ) {
38
- let stepType
38
+ let stepType ;
39
39
// @deprecated Q
40
- if ( ! groups . stepType || [ 'Q' , 'T' ] . includes ( groups . stepType ) ) {
41
- stepType = 'T' // test
40
+ if ( ! groups . stepType || [ "Q" , "T" ] . includes ( groups . stepType ) ) {
41
+ stepType = "T" ; // test
42
42
// @deprecated A
43
- } else if ( ! groups . stepType || [ 'A' , 'S' ] . includes ( groups . stepType ) ) {
44
- stepType = 'S' // solution
43
+ } else if ( ! groups . stepType || [ "A" , "S" ] . includes ( groups . stepType ) ) {
44
+ stepType = "S" ; // solution
45
45
}
46
- position = `${ groups . levelId } .${ groups . stepId } :${ stepType } `
46
+ position = `${ groups . levelId } .${ groups . stepId } :${ stepType } ` ;
47
47
} else if ( groups . levelId ) {
48
- position = groups . levelId
48
+ position = groups . levelId ;
49
49
} else {
50
- console . warn ( `No matcher for commit "${ commit . message } "` )
50
+ console . warn ( `No matcher for commit "${ commit . message } "` ) ;
51
51
}
52
- commits [ position ] = [ ...( commits [ position ] || [ ] ) , commit . hash ]
52
+ commits [ position ] = [ ...( commits [ position ] || [ ] ) , commit . hash ] ;
53
53
positions . unshift ( position ) ;
54
54
} else {
55
55
const initMatches = commit . message . match ( / ^ I N I T / ) ;
56
56
if ( initMatches && initMatches . length ) {
57
- commits . INIT = [ ... ( commits . INIT || [ ] ) , commit . hash ]
57
+ commits . INIT = [ commit . hash , ... ( commits . INIT || [ ] ) ] ;
58
58
positions . unshift ( "INIT" ) ;
59
59
}
60
60
}
0 commit comments