Skip to content

Adding lints

There are two enums in the code are the main drivers of how lints operate:

  1. LintCheck enum contains all the lint checks
  2. LintError enum contains all the errors that can be produced by the LintCheck::check() method

If you want to add a new lint to scilo, there are a few places you'll need to make changes.

  1. Add a new variant to the LintCheck and add a match case to LintCheck::check() for the new variant.
  2. Add a new error variant to the LintError, if appropriate, and add user-friendly error messages.
  3. Add the lint's code and description to the Lints page in alphabetical order.
  4. Add the lint's code to the default value for the lints configuration option and in the default config.toml file in the libscilo crate.

If there is a new configuration option that is required to accommodate this new lint, see Updating the configuration file.