Refactor processing lint warnings

Extract out a function to make the code slightly easier to read.
This commit is contained in:
Christopher Baines 2020-02-01 10:32:49 +01:00
parent 91249f5ee0
commit ee82c2c71d

View file

@ -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)))))