console icon indicating copy to clipboard operation
console copied to clipboard

console: enable and disable warnings from config files

Open hawkw opened this issue 3 years ago • 3 comments

What problem are you trying to solve?

The console supports a variety of warnings which indicate potential issues in the application being monitored. However, a warning is just that, a warning --- a warning may in some cases be generated by a task that is behaving correctly. Therefore, in some cases, users may want to disable some warnings for a particular project.

How should the problem be solved?

PR #320 adds support for reading from a TOML config file to configure the console CLI. Currently, the config file has all of the same configuration options as the console CLI's command-line arguments.

We should add a new section to the configuration file for enabling or disabling warnings by name.

Any alternatives you've considered?

We could also configure warnings from a CLI argument. I think it's important to make the warnings configurable from the config file, because it allows a project to enable or disable certain warnings in a way that can be checked into a source control repository for that project. However, it may also be desirable to support enabling/disabling warnings as a CLI argument as well as from the config file.

How would users interact with this feature?

A sample config file might look like this:

# ... other configurations ...

[warnings]
# enable the "lost waker" warning
lost_waker = true
# disable the "self wake percent" warning
self_wake_percent = false

If a particular project wants to ignore a lint for all developers, that configuration file can be checked into source control, since the console will override the user-level default settings from a directory-local console.toml.

Would you like to work on this feature?

maybe

hawkw avatar Apr 12 '22 19:04 hawkw

A potential follow-up might also be to support configuration values associated with warnings, such as the threshold percentage for the self-wake warning.

hawkw avatar Apr 12 '22 19:04 hawkw

I am working on this.

0xPoe avatar Apr 13 '22 14:04 0xPoe

Related: https://github.com/tokio-rs/console/issues/148

hawkw avatar Apr 25 '22 16:04 hawkw