Skip to content

warnings: toggleable warnings #148

Open
@hawkw

Description

@hawkw

Users should be able to turn individual warnings on and off, using the command line and/or possibly an eventual config file. I discussed this briefly in #56 (comment).

Here's a rough summary of how I imagine this would work:

  • Add a (reasonably) short, CLI-friendly name to lints.
    • This would probably be a short string name without spaces, something like self_wake_percent for the self-wake percentage lint.
    • We may also want to add numeric identifiers for lints.
    • This could be done by adding a function to the warnings::Warn trait returning an &'static str? It would unfortunately have to be a function rather than an associated const, since the Warn trait has to be object-safe.
  • Store warnings in some kind of map from short names -> warnings.
    • One potential way to do this is using a compile-time hashmap like the phf crate.
  • Add a CLI flag taking a list of lints to disable.
    • We may also want to add one that takes a list of lints to enable, in case we add lints that are not enabled by default
    • This would also be useful coupled with a --no-default-lints or similar.
  • When the console starts, we would construct the list of lints based on the CLI arguments if they are provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-warningsArea: warningsC-consoleCrate: console.E-mediumEffort: medium.S-featureSeverity: feature. This is adding a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions