@@ -141,28 +141,30 @@ async function main(options) {
141
141
opts . parserOpts . commentChar = '#' ;
142
142
}
143
143
144
- return Promise . all (
145
- messages . map ( async message => {
146
- const report = await lint ( message , loaded . rules , opts ) ;
147
- const formatted = format ( report , { color : flags . color } ) ;
148
- const input =
149
- report . errors . length > 0
150
- ? `\n${ report . input } \n`
151
- : message . split ( '\n' ) [ 0 ] ;
152
-
153
- if ( ! flags . quiet ) {
154
- console . log ( `${ fmt . grey ( '⧗' ) } input: ${ fmt . bold ( input ) } ` ) ;
155
- console . log ( formatted . join ( '\n' ) ) ;
156
- }
157
-
158
- if ( report . errors . length > 0 ) {
159
- const error = new Error ( formatted [ formatted . length - 1 ] ) ;
160
- error . type = pkg . name ;
161
- throw error ;
162
- }
163
- console . log ( '' ) ;
164
- } )
144
+ const reports = await Promise . all (
145
+ messages . map ( message => lint ( message , loaded . rules , opts ) )
165
146
) ;
147
+
148
+ return reports . map ( report => {
149
+ const formatted = format ( report , { color : flags . color } ) ;
150
+ const input =
151
+ report . errors . length > 0
152
+ ? `\n${ report . input } \n`
153
+ : report . input . split ( '\n' ) [ 0 ] ;
154
+
155
+ if ( ! flags . quiet ) {
156
+ console . log ( `${ fmt . grey ( '⧗' ) } input: ${ fmt . bold ( input ) } ` ) ;
157
+ console . log ( formatted . join ( '\n' ) ) ;
158
+ }
159
+
160
+ if ( report . errors . length > 0 ) {
161
+ const error = new Error ( formatted [ formatted . length - 1 ] ) ;
162
+ error . type = pkg . name ;
163
+ throw error ;
164
+ }
165
+ console . log ( '' ) ;
166
+ return '' ;
167
+ } ) ;
166
168
}
167
169
168
170
function checkFromStdin ( input , flags ) {
@@ -199,7 +201,7 @@ function getEditValue(flags) {
199
201
}
200
202
return process . env [ flags . env ] ;
201
203
}
202
- const edit = flags . edit ;
204
+ const { edit} = flags ;
203
205
// If the edit flag is set but empty (i.e '-e') we default
204
206
// to .git/COMMIT_EDITMSG
205
207
if ( edit === '' ) {
0 commit comments