All error messages should have a code. This way we can selectively ignore them with annotations or disable checks alltogether.
In general, there is a bigger refactoring necessary:
Each check should be its own class, including the "internal"
checks, not only the rules from "rulesets". They do not have to be
registered as-such, but should follow the same framework.
Each check should have richer metadata structure, similar to eslint:
code => short descriptive code in lisp-naming-style-with-dashes
level => notice, warning, error
description => Human readable description, i.e. docstring
messages => all the messages this check can produce. It's an
alist from "code" to a format string. Format string should look
like "The form ${form} can not accept type ${type}" (like
s-lex-format). The placeholders will be extracted and supplied
as plist values: pseudo code (make-message this form :id bla :form ... :name ...), where this is the check instance (maybe
could be omited).
schema: configuration schema. We should provide way to configure
rules similar to eslint... but this is next step.
All error messages should have a code. This way we can selectively ignore them with annotations or disable checks alltogether.
In general, there is a bigger refactoring necessary:
"The form ${form} can not accept type ${type}"
(likes-lex-format
). The placeholders will be extracted and supplied as plist values: pseudo code(make-message this form :id bla :form ... :name ...)
, wherethis
is the check instance (maybe could be omited).