File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ def main() -> int:
37
37
cmd += Config .base_args
38
38
cmd .append (lisp_code )
39
39
40
- return_code = 0
40
+ num_formatted = 0
41
+ num_checked = 0
41
42
for filename in args .filenames :
42
43
with open (filename , "r+" ) as f :
43
44
with subprocess .Popen (
@@ -56,8 +57,10 @@ def main() -> int:
56
57
f .truncate ()
57
58
f .write (formatted_code )
58
59
logging .info (f"{ filename } successfully formatted" )
60
+ num_checked += 1
59
61
if file_content != formatted_code :
60
- return_code = 1
62
+ num_formatted += 1
63
+ print (f"reformatted { filename } " )
61
64
else :
62
65
logging .error (f"{ errs } " )
63
66
@@ -66,7 +69,11 @@ def main() -> int:
66
69
_ , errs = proc .communicate ()
67
70
logging .error (f"Subprocess timed out: { errs } " )
68
71
return proc .returncode
69
- return return_code
72
+ if num_formatted > 0 :
73
+ print (f"{ num_formatted } file(s) formatted, { num_checked } files checked" )
74
+ return 1
75
+ else :
76
+ return 0
70
77
71
78
72
79
def construct_lisp_code (tab_width : int , custom_eval : str ) -> str :
You can’t perform that action at this time.
0 commit comments