Skip to content

Commit e0f59fa

Browse files
authored
Only include summary in pull request message (#412)
Closes #411.
1 parent 482522a commit e0f59fa

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

cli.rkt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -296,28 +296,6 @@ For help on these, use 'analyze --help' or 'fix --help'."
296296

297297

298298
(define (resyntax-fix-print-git-commit-message analysis)
299-
(display "This is an automated change generated by Resyntax.\n\n")
300-
(for ([pass-results (resyntax-analysis-all-results analysis)]
301-
[pass-number (in-naturals 1)])
302-
(unless (hash-empty? pass-results)
303-
(printf "#### Pass ~a\n\n" pass-number))
304-
(for ([(source result-set) (in-hash pass-results)])
305-
(define result-count (length (refactoring-result-set-results result-set)))
306-
(define fix-string (if (> result-count 1) "fixes" "fix"))
307-
;; For a commit message, we always use a relative path since we're likely running inside
308-
;; some CI runner. Additionally, we make the path a link to the corresponding file at HEAD,
309-
;; since making file paths clickable is pleasant.
310-
(define relative-path (find-relative-path (current-directory) (source-path source)))
311-
(define repo-head-path (format "../blob/HEAD/~a" relative-path))
312-
(printf "Applied ~a ~a to [`~a`](~a)\n\n"
313-
result-count fix-string relative-path repo-head-path)
314-
(for ([result (in-list (refactoring-result-set-results result-set))])
315-
(define line (refactoring-result-original-line result))
316-
(define rule (refactoring-result-rule-name result))
317-
(define message (refactoring-result-message result))
318-
(printf " * Line ~a, `~a`: ~a\n" line rule message))
319-
(newline)))
320-
(printf "## Summary\n\n")
321299
(define total-fixes (resyntax-analysis-total-fixes analysis))
322300
(define total-files (resyntax-analysis-total-sources-modified analysis))
323301
(define fix-counts-by-rule
@@ -327,8 +305,8 @@ For help on these, use 'analyze --help' or 'fix --help'."
327305
(define issue-string (if (> total-fixes 1) "issues" "issue"))
328306
(define file-string (if (> total-files 1) "files" "file"))
329307
(if (zero? total-fixes)
330-
(printf "No issues found.\n")
331-
(printf "Fixed ~a ~a in ~a ~a.\n\n" total-fixes issue-string total-files file-string))
308+
(printf "Resyntax found no issues.\n")
309+
(printf "Resyntax fixed ~a ~a in ~a ~a.\n\n" total-fixes issue-string total-files file-string))
332310
(for ([rule+count (in-list fix-counts-by-rule)])
333311
(match-define (entry rule count) rule+count)
334312
(define occurrence-string (if (> count 1) "occurrences" "occurrence"))

0 commit comments

Comments
 (0)