@@ -306,6 +306,12 @@ For help on these, use 'analyze --help' or 'fix --help'."
306306 (append-mapping refactoring-result-set-results)
307307 #:into into-list))
308308
309+ (define (pluralize-match count)
310+ (if (equal? count 1 ) "match " "matches " ))
311+
312+ (define (pluralize-rule count)
313+ (if (equal? count 1 ) "rule " "rules " ))
314+
309315 (define (display-summary-stats)
310316 (cond
311317 [(resyntax-analyze-options-has-rule-filter? options)
@@ -322,8 +328,8 @@ For help on these, use 'analyze --help' or 'fix --help'."
322328 #:into into-list))
323329 (for ([file+count (in-list matches-by-file)])
324330 (match-define (entry file-path count) file+count)
325- (printf " ~a: ~a match ~a\n " file-path count (if (equal? count 1 ) "" " es " )))
326- (printf "\n Total: ~a match ~a\n " (length results) (if (equal? ( length results) 1 ) "" " es " ))]
331+ (printf " ~a: ~a ~a\n " file-path count (pluralize-match count)))
332+ (printf "\n Total: ~a ~a\n " (length results) (pluralize-match ( length results)))]
327333 [else
328334 ;; When no rule filter is given, print matches per rule
329335 (displayln "resyntax: --- summary statistics (matches per rule) ---\n " )
@@ -335,12 +341,12 @@ For help on these, use 'analyze --help' or 'fix --help'."
335341 #:into into-list))
336342 (for ([rule+count (in-list matches-by-rule)])
337343 (match-define (entry rule-name count) rule+count)
338- (printf " ~a: ~a match ~a\n " rule-name count (if (equal? count 1 ) "" " es " )))
339- (printf "\n Total: ~a match ~a across ~a rule ~a\n "
344+ (printf " ~a: ~a ~a\n " rule-name count (pluralize-match count)))
345+ (printf "\n Total: ~a ~a across ~a ~a\n "
340346 (length results)
341- (if (equal? ( length results) 1 ) "" " es " )
347+ (pluralize-match ( length results))
342348 (length matches-by-rule)
343- (if (equal? ( length matches-by-rule) 1 ) "" " s " ))]))
349+ (pluralize-rule ( length matches-by-rule)))]))
344350
345351 (define (display-results)
346352 (match (resyntax-analyze-options-output-format options)
0 commit comments