Open
Description
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 theWarn
trait has to be object-safe.
- This would probably be a short string name without spaces, something like
- 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.
- One potential way to do this is using a compile-time hashmap like the
- 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.