feat: add --quiet CLI option - #254
Conversation
🦋 Changeset detectedLatest commit: ee12228 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Solant
left a comment
There was a problem hiding this comment.
Hey 👋
Thanks for taking time and contributing to the project!
I have some concerns regarding the test implementation and the flag itself. I'll mark this PR with "Request changes", but don't change the implementation yet. Can you tell me a bit about what you want to achieve and why do you need this feature?
Hello! Thanks for the review! Yes, you're right, the idea is partly inspired by Eslint's In my project, some rules are intentionally set as With I believe that Steiger's configuration and However, I agree with you that the interaction with I also agree with the concerns about the integration test. If we can discuss the desired CLI behavior, I can rework the test. In short, I need a way to temporarily output only errors, while still being able to configure warnings, rather than permanently disabling rules. |
|
Ok, this makes sense. I like the idea of making those flags mutually exclusive to prevent silent errors. A couple of suggestions:
|
d507733 to
4b6dda7
Compare
Thanks for the feedback! I've updated the pull request.
I'm not entirely sure if I implemented the tests correctly; I followed the smoke test example. |
|
There was an error with the tests, I tried to fix it. |
|
Yeah, those tests are a bit of a pain to work with 🥲 I can suggest you try to run them locally in both Windows (via CMD, not powershell) and Linux/MacOS. But if it is too troublesome, feel free to remove the test for this flag completely. This change is relatively small, so I think it is ok to add those tests later. |
|
Now the test seems to be running successfully. I literally increased the timeout to 15 seconds, but the existing smoke test is now exceeding the default timeout by 37 ms... Tests sometimes behave very strangely. I had a similar situation: the execution took over 5 seconds, and then it completed in less than a second :)) As far as I know, they run in parallel. Perhaps, as an option, I should change them to run sequentially using fileParallelism: false? What do you think? |
|
Sure, we can try longer timeouts and/or different parallelism strategy We'll definitely need to check how to make those tests more stable |
Okay, I'll come back to this question when I have some free time :) |
What changed
Adds a
--quietCLI option that suppresses warning diagnostics from reporter output while preserving errors.Behavior
steiger ./src --quietreports errors only--fail-on-warnings--quietworks with bothprettyandjsonreportersTesting
Added integration tests covering:
--quiet--quiet --fail-on-warningsMotivation
This makes it possible to use warnings for advisory rules while keeping normal CLI output focused on errors.