Commit 242847f 1 parent b6257e0 commit 242847f Copy full SHA for 242847f
File tree 2 files changed +18
-4
lines changed
2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ feefifofum <directory1> <directory2> # Format all feature files in multiple dir
46
46
```
47
47
48
48
### Output
49
- In its default setting, ` feefifofum ` will only log the total number of files formatted to the console.
50
- The ` --verbose ` or ` -v ` flag can be passed to log information on which files have been formatted and overall progress.
49
+ In its default setting, ` feefifofum ` will only log the total number of formatted and unchanged files to the console.
50
+ Files marked as 'unchanged' already meet the required formatting standard and therefore no changes are written to these files.
51
+
52
+ The ` --verbose ` or ` -v ` flag can be passed to log realtime information on which files have been formatted (or are unchanged), and overall progress.
51
53
``` shell
52
54
feefifofum < file1> < file2> < file3> --verbose
53
55
```
Original file line number Diff line number Diff line change @@ -21,13 +21,25 @@ def main() -> None: # pragma: no cover
21
21
logging .warning ('No feature file(s) found in specified path(s)' )
22
22
return
23
23
24
+ changed_count , unchanged_count = 0 , 0
24
25
for index , file_path in enumerate (file_paths , 1 ):
25
26
file_lines = read_file_lines (file_path )
26
27
formatted_file_lines = format_feature_file (file_lines )
28
+
29
+ if file_lines == formatted_file_lines :
30
+ logging .debug (f'({ index } /{ file_count } ) | unchanged | { file_path } ' )
31
+ unchanged_count += 1
32
+ continue
33
+
27
34
write_file_lines (formatted_file_lines , file_path )
28
- logging .debug (f'Formatted: { file_path } ({ index } /{ file_count } )' )
35
+ logging .debug (f'({ index } /{ file_count } ) | formatted | { file_path } ' )
36
+ changed_count += 1
37
+
38
+ if changed_count :
39
+ logging .info (f'{ changed_count } file(s) formatted' )
29
40
30
- logging .info (f'Formatted { file_count } file(s)' )
41
+ if unchanged_count :
42
+ logging .info (f'{ unchanged_count } file(s) unchanged' )
31
43
32
44
33
45
if __name__ == '__main__' : # pragma: no cover
You can’t perform that action at this time.
0 commit comments