File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
### Fixed
6
6
- Type inference in grammar
7
+ - Improved linter exec user experience
7
8
8
9
## [ 3.2.2] 2020-02-03
9
10
Original file line number Diff line number Diff line change @@ -81,16 +81,26 @@ def main(): # pylint: disable=too-many-branches
81
81
)
82
82
config [key ] = DEFAULT_CONFIG [key ]
83
83
84
+ problems_total = 0
84
85
for file_path in arguments ["<file>" ]:
85
86
with open (file_path , "r" ) as fh : # TODO: handle exception
86
87
content = fh .read ()
87
88
problems = lint_code (content , config )
89
+ problems_total += len (problems )
88
90
if len (problems ) > 0 : # TODO: friendly frontend like in halint
89
91
for problem in problems :
90
92
print_problem (problem , file_path )
91
- sys .exit (1 )
92
93
93
- logging .info ("Success: no problems found" )
94
+ if problems_total > 0 :
95
+ print (
96
+ "Failure: {} problem{} found" .format (
97
+ problems_total , "" if problems_total == 1 else "s"
98
+ ),
99
+ file = sys .stderr ,
100
+ )
101
+ sys .exit (1 )
102
+
103
+ print ("Success: no problems found" )
94
104
95
105
96
106
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments