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

feat: add quiet flag #4748

Merged
merged 2 commits into from
Aug 27, 2023
Merged

feat: add quiet flag #4748

merged 2 commits into from
Aug 27, 2023

Conversation

evenstensberg
Copy link
Contributor

@evenstensberg evenstensberg commented Aug 26, 2023

Closes #4742
Tests needs to be added, I'm not that familar with the repo, could you just pick up the rest? Thx! ❤️

@Zamiell
Copy link
Contributor

Zamiell commented Aug 26, 2023

Remember to edit the PR text to say Closes #4742 so that it is linked to the issue.

@evenstensberg
Copy link
Contributor Author

Updated 👍🏾

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 27, 2023

@evenstensberg,

Thank you for adding this. The actual change is much simpler.

Only one file needs to be changed and a snapshot updated. The rest of the files will get automatically updated.

diff --git a/packages/cspell/src/app/commandLint.ts b/packages/cspell/src/app/commandLint.ts
index d9c353c27..982990563 100644
--- a/packages/cspell/src/app/commandLint.ts
+++ b/packages/cspell/src/app/commandLint.ts
@@ -96,6 +96,7 @@ export function commandLint(prog: Command): Command {
         .option('--no-progress', 'Turn off progress messages')
         .option('--no-summary', 'Turn off summary message in console.')
         .option('-s, --silent', 'Silent mode, suppress error messages.')
+        .addOption(new CommanderOption('--quiet', 'An alias of --silent').implies({ silent: true }))
         .option('--fail-fast', 'Exit after first file with an issue or error.')
         .addOption(new CommanderOption('--no-fail-fast', 'Process all files even if there is an error.').hideHelp())
         .option('-r, --root <root folder>', 'Root directory, defaults to current directory.')
diff --git a/packages/cspell/src/app/__snapshots__/app.test.ts.snap b/packages/cspell/src/app/__snapshots__/app.test.ts.snap
index 873719d57..85e1e3e1c 100644
--- a/packages/cspell/src/app/__snapshots__/app.test.ts.snap
+++ b/packages/cspell/src/app/__snapshots__/app.test.ts.snap
@@ -513,6 +513,7 @@ exports[`Validate cli > app 'no-args' Expect Error: 'outputHelp' 1`] = `
   "  --no-progress                Turn off progress messages",
   "  --no-summary                 Turn off summary message in console.",
   "  -s, --silent                 Silent mode, suppress error messages.",
+  "  --quiet                      An alias of --silent",
   "  --fail-fast                  Exit after first file with an issue or error.",
   "  -r, --root <root folder>     Root directory, defaults to current directory.",
   "  --relative                   Issues are displayed relative to root.",

@evenstensberg
Copy link
Contributor Author

evenstensberg commented Aug 27, 2023

@Jason3S tried to run the project locally to update the snapshots, but it didn't work. Could you fix that? 👍🏾

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 27, 2023

@evenstensberg,

I see you figured it out.

@evenstensberg
Copy link
Contributor Author

@Jason3S yep! Thx 😄

@Jason3S Jason3S merged commit 8fa400b into streetsidesoftware:main Aug 27, 2023
80 checks passed
@evenstensberg
Copy link
Contributor Author

@Jason3S this would be version 7.0.2?

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 28, 2023

It will be part of 7.1.0

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 28, 2023

@evenstensberg,

There was an issue with the publishing script, it issued the wrong version. Your change is in 7.0.2 and in 7.1.1. There is no 7.1.0.

@evenstensberg
Copy link
Contributor Author

@Jason3S np, also an OSS maintainer so know how easy it is to get that wrong. Thanks for publishing, and thank you for cspell! I donated a bit and hope it gives you motivation to continue working in Open Source ❤️

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 28, 2023

@evenstensberg,

Thank you for the donation.

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 28, 2023

@evenstensberg,

After trying it out, I'm not sure if --quiet should be a alias of --silent. --silent is only an error code, no message.

I think --quiet would be better of being --no-summary and --no-progress, to only show issues.

As it is, if the spell check finds spelling issues, it will just return a non-zero result without a message.

@evenstensberg
Copy link
Contributor Author

@Jason3S Quiet should only emit errors, nothing else that bloats logs. Atm using --quiet to get the CI pass with npm-run-all, which globs npm commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add --quiet option to omit warnings but show errors
3 participants