Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings: toggleable warnings #148

Open
4 tasks
hawkw opened this issue Sep 16, 2021 · 0 comments
Open
4 tasks

warnings: toggleable warnings #148

hawkw opened this issue Sep 16, 2021 · 0 comments
Labels
A-warnings Area: warnings C-console Crate: console. E-medium Effort: medium. S-feature Severity: feature. This is adding a new feature.

Comments

@hawkw
Copy link
Member

hawkw commented Sep 16, 2021

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-warnings Area: warnings C-console Crate: console. E-medium Effort: medium. S-feature Severity: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant