ty icon indicating copy to clipboard operation
ty copied to clipboard

Add ability to hide all warnings

Open tino opened this issue 2 months ago • 2 comments

I just want to focus on errors for now. I guess I can look up all the warning rules and call --ignore <RULE> for each but that's a bit tedious.

| grep -v warning works for the concise output format, but having a --errors-only or something like it would still be very nice!

tino avatar Dec 22 '25 18:12 tino

This seems like a reasonable thing to have (cc @MichaReiser)

ESLint uses the --quiet flag to hide warnings (https://eslint.org/docs/latest/use/command-line-interface#--quiet)

Biome uses --diagnostic-level:

--diagnostic-level=<info|warn|error> — The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing --diagnostic-level=error will cause Biome to print only diagnostics that contain only errors.

dhruvmanila avatar Dec 23 '25 05:12 dhruvmanila

The proper solution here depends on what exactly the issue author is looking for.

Adding a CLI flag to hide warning diagnostics is certainly something we can do. However, this won't hide the warnings in the editor.

The alternative to this would be something like profiles (see https://github.com/astral-sh/ty/issues/2129) that allow users to easily configure ty's strictness.

@tino can you say a little more about your specific use case?

MichaReiser avatar Dec 23 '25 08:12 MichaReiser

@MichaReiser I was about to open a similar issue My use case is running it during CI My project currently have 800+ warnings But only errors will block our CI, and I want other devs in the team to clearly see them when they happen

athoscouto avatar Dec 30 '25 17:12 athoscouto

But only errors will block our CI, and I want other devs in the team to clearly see them when they happen

Thanks. That's helpful. As another alternative design. Cargo has a warnings category. It's a bit weird because the category is dynamic. You only know what rules are in the warnings set after resolving the entire configuration. But it avoids any extra config flags. But it's a flexible combination of error-on-warning and any --ignore warnings

MichaReiser avatar Dec 30 '25 17:12 MichaReiser