File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ inputs:
29
29
description : ' Just fix files (`clang-format -i`) instead of returning a diff'
30
30
required : false
31
31
default : False
32
+ skipIfNoFilesFound :
33
+ description : ' Skip if no files found'
34
+ required : false
35
+ default : False
32
36
runs :
33
37
using : ' docker'
34
38
image : ' Dockerfile'
46
50
- ${{ inputs.extensions }}
47
51
- --exclude
48
52
- ${{ inputs.exclude }}
53
+ - --skip-if-no-files-found
54
+ - ${{ inputs.skipIfNoFilesFound }}
49
55
- ${{ inputs.source }}
Original file line number Diff line number Diff line change @@ -304,6 +304,14 @@ def main():
304
304
type = lambda x : bool (strtobool (x )),
305
305
default = False ,
306
306
help = 'Just fix files (`clang-format -i`) instead of returning a diff' )
307
+ parser .add_argument (
308
+ '-s' ,
309
+ '--skip-if-no-files-found' ,
310
+ type = lambda x : bool (strtobool (x )),
311
+ default = False ,
312
+ help = 'Skip if no files found' )
313
+
314
+
307
315
308
316
args = parser .parse_args ()
309
317
@@ -356,7 +364,10 @@ def main():
356
364
357
365
if not files :
358
366
print_trouble (parser .prog , 'No files found' , use_colors = colored_stderr )
359
- return ExitStatus .TROUBLE
367
+ if args .skip_if_no_files_found :
368
+ return ExitStatus .SUCCESS
369
+ else :
370
+ return ExitStatus .TROUBLE
360
371
361
372
if not args .quiet :
362
373
print ('Processing %s files: %s' % (len (files ), ', ' .join (files )))
You can’t perform that action at this time.
0 commit comments