Elsa icon indicating copy to clipboard operation
Elsa copied to clipboard

Refactor checks and messages to be centered around code

Open Fuco1 opened this issue 1 year ago • 0 comments

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:

  1. 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.
  2. 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.

Fuco1 avatar Mar 06 '23 23:03 Fuco1