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))
|
',checker-name))
|
||||||
%local-checkers))
|
%local-checkers))
|
||||||
(check (lint-checker-check checker)))
|
(check (lint-checker-check checker)))
|
||||||
(filter
|
|
||||||
(match-lambda
|
(define (process-lint-warning lint-warning)
|
||||||
((package-id . warnings)
|
|
||||||
(not (null? warnings))))
|
|
||||||
(hash-map->list
|
|
||||||
(lambda (package-id package)
|
|
||||||
(cons
|
|
||||||
package-id
|
|
||||||
(map
|
|
||||||
(lambda (lint-warning)
|
|
||||||
(list
|
(list
|
||||||
(match (lint-warning-location lint-warning)
|
(match (lint-warning-location lint-warning)
|
||||||
(($ <location> file line column)
|
(($ <location> file line column)
|
||||||
|
|
@ -296,6 +288,16 @@ WHERE job_id = $1"
|
||||||
(list ,@locales))))
|
(list ,@locales))))
|
||||||
(cons (cons source-locale source-message)
|
(cons (cons source-locale source-message)
|
||||||
messages-by-locale))))
|
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))))
|
(check package))))
|
||||||
%package-table)))))
|
%package-table)))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue