Skip to content

Commit

Permalink
GitHub Issue #145 - tweak CLI verbiage only one file is checked or fo…
Browse files Browse the repository at this point in the history
…rmatted (#148)
  • Loading branch information
oakmac authored Oct 29, 2024
1 parent e52d62e commit 652c823
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ function processCheckCmd (argv) {
if (atLeastOneFilePrinted) printToStdout('')

if (allFilesFormatted) {
printToStdout(yocto.green('All ' + sortedFiles.length + ' ' + fileStr(sortedFiles.length) + ' formatted with Standard Clojure Style 👍') + ' ' + formatDuration(scriptDurationMs))
if (sortedFiles.length === 1) {
printToStdout(yocto.green('1 file formatted with Standard Clojure Style 👍') + ' ' + formatDuration(scriptDurationMs))
} else {
printToStdout(yocto.green('All ' + sortedFiles.length + ' files formatted with Standard Clojure Style 👍') + ' ' + formatDuration(scriptDurationMs))
}
} else {
printToStdout(yocto.green(checkResult.filesThatDidNotRequireFormatting.length + ' ' + fileStr(checkResult.filesThatDidNotRequireFormatting.length) + ' formatted with Standard Clojure Style'))
printToStdout(yocto.red(checkResult.filesThatDidRequireFormatting.length + ' ' + fileStr(checkResult.filesThatDidRequireFormatting.length) + ' require formatting'))
Expand Down Expand Up @@ -433,7 +437,11 @@ function processFixCmdNotStdin (argv) {
if (atLeastOneFilePrinted) printToStdout('')

if (allFilesFormatted) {
printToStdout(yocto.green('All ' + sortedFiles.length + ' files formatted with Standard Clojure Style 👍') + ' ' + formatDuration(scriptDurationMs))
if (sortedFiles.length === 1) {
printToStdout(yocto.green('1 file formatted with Standard Clojure Style 👍') + ' ' + formatDuration(scriptDurationMs))
} else {
printToStdout(yocto.green('All ' + sortedFiles.length + ' files formatted with Standard Clojure Style 👍') + ' ' + formatDuration(scriptDurationMs))
}
} else {
printToStdout(yocto.green(numFormattedFiles + ' files formatted with Standard Clojure Style'))
printToStdout(yocto.red(formatResult.filesWithErrors.length + ' files with errors'))
Expand Down

0 comments on commit 652c823

Please sign in to comment.