Reporter is inspired from codespan. The purpose of this project is to create a util toolbox for compiler error reporting.
raco pkg install --auto reporter
Take a look at example.
#lang racket
(require reporter)
(displayln
(report
#:error-code "E0001"
#:message "type mismatching"
#:target srcloc?
#:labels (list
(label srcloc? "cannot assign a `string` to `int` variable"
#:color 'red)
(label srcloc? "`x` is a `int` variable"
#:color 'blue))
#:hint "expected type `int`, found type `string`"))
(displayln (warning #:message "shadow the variable"
#:target srcloc?
#:labels (list
(label srcloc? "previous definition" #:color 'green)
(label srcloc? "shadow definition" #:color 'blue))
#:hint "rename the shadow variable"))