File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const initConfig: Config = {
1111 entries : [ ] ,
1212 filter : {
1313 files : [ ] ,
14- logs : [ ]
14+ logs : [ ] ,
1515 } ,
1616 teams : {
1717 'example-team-a' : [ 'John Doe' , 'Jane Doe' ] ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export type Filter = {
66export type Config = {
77 scopes : string [ ] ;
88 groups : string [ ] ;
9- filter : Filter ,
9+ filter : Filter ;
1010 teams : Record < string , string [ ] > ;
1111 entries : [ ] ;
1212} ;
@@ -18,6 +18,6 @@ export const emptyConfig: Config = {
1818 entries : [ ] ,
1919 filter : {
2020 logs : [ ] ,
21- files : [ ]
22- }
21+ files : [ ] ,
22+ } ,
2323} ;
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ export async function aggregateHotspots(
9292 let count = 0 ;
9393 for ( const hotspot of hotspots ) {
9494 if (
95- hotspot . fileName . startsWith ( module ) &&
96- hotspot . score >= criteria . minScore
95+ hotspot . fileName . startsWith ( module )
96+ //&& hotspot.score >= criteria.minScore
9797 ) {
9898 count ++ ;
9999 }
@@ -118,11 +118,13 @@ async function analyzeLogs(
118118 filter,
119119 } ;
120120
121+ const module = criteria . module ? normalizeFolder ( criteria . module ) : '' ;
122+
121123 await parseGitLog ( ( entry ) => {
122124 for ( const change of entry . body ) {
123125 let hotspot : Hotspot ;
124126
125- if ( ! change . path . startsWith ( criteria . module ) ) {
127+ if ( ! change . path . startsWith ( module ) ) {
126128 continue ;
127129 }
128130
Original file line number Diff line number Diff line change @@ -261,10 +261,7 @@ describe('git parser', () => {
261261 limitMonths : 0 ,
262262 } ,
263263 filter : {
264- logs : [
265- 'does not match' ,
266- 'format with prettier'
267- ] ,
264+ logs : [ 'does not match' , 'format with prettier' ] ,
268265 } ,
269266 } ;
270267
@@ -577,15 +574,14 @@ describe('git parser', () => {
577574 ] ) ;
578575 } ) ;
579576
580-
581577 it ( 'filters files' , async ( ) => {
582578 const parseOptions : ParseOptions = {
583579 limits : {
584580 limitCommits : 2 ,
585581 limitMonths : 0 ,
586582 } ,
587583 filter : {
588- files : [ '**/*.ts' , '!**/*.spec.ts' ]
584+ files : [ '**/*.ts' , '!**/*.spec.ts' ] ,
589585 } ,
590586 } ;
591587
@@ -594,7 +590,6 @@ describe('git parser', () => {
594590 parseGitLog ( ( entry ) => {
595591 entries . push ( entry ) ;
596592 } , parseOptions ) ;
597-
598593 } ) ;
599- } )
594+ } ) ;
600595} ) ;
Original file line number Diff line number Diff line change @@ -34,23 +34,25 @@ const initHeader: LogHeader = {
3434
3535export type ParseOptions = {
3636 limits : Limits ;
37- filter ?: Filter
37+ filter ?: Filter ;
3838} ;
3939
4040export const defaultParseOptions : ParseOptions = {
4141 limits : noLimits ,
4242 filter : {
4343 files : [ ] ,
44- logs : [ ]
45- }
44+ logs : [ ] ,
45+ } ,
4646} ;
4747
4848export async function parseGitLog (
4949 callback : ParserCallback ,
5050 options = defaultParseOptions
5151) {
5252 const limits = options . limits ;
53- const fileFilter = ( options . filter ?. files ?. length ) ? options . filter . files : [ '**/*.ts' ] ;
53+ const fileFilter = options . filter ?. files ?. length
54+ ? options . filter . files
55+ : [ '**/*.ts' ] ;
5456
5557 let pos = 0 ;
5658 const log = loadCachedLog ( ) ;
You can’t perform that action at this time.
0 commit comments