Refactor processing lint warnings
Extract out a function to make the code slightly easier to read.
This commit is contained in:
parent
91249f5ee0
commit
ee82c2c71d
1 changed files with 44 additions and 42 deletions
|
|
@ -247,16 +247,8 @@ WHERE job_id = $1"
|
|||
',checker-name))
|
||||
%local-checkers))
|
||||
(check (lint-checker-check checker)))
|
||||
(filter
|
||||
(match-lambda
|
||||
((package-id . warnings)
|
||||
(not (null? warnings))))
|
||||
(hash-map->list
|
||||
(lambda (package-id package)
|
||||
(cons
|
||||
package-id
|
||||
(map
|
||||
(lambda (lint-warning)
|
||||
|
||||
(define (process-lint-warning lint-warning)
|
||||
(list
|
||||
(match (lint-warning-location lint-warning)
|
||||
(($ <location> file line column)
|
||||
|
|
@ -296,6 +288,16 @@ WHERE job_id = $1"
|
|||
(list ,@locales))))
|
||||
(cons (cons source-locale source-message)
|
||||
messages-by-locale))))
|
||||
|
||||
(filter
|
||||
(match-lambda
|
||||
((package-id . warnings)
|
||||
(not (null? warnings))))
|
||||
(hash-map->list
|
||||
(lambda (package-id package)
|
||||
(cons
|
||||
package-id
|
||||
(map process-lint-warning
|
||||
(check package))))
|
||||
%package-table)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue