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

Add a --quiet option for fix #4764

Merged
merged 8 commits into from
Apr 19, 2023
Merged

Add a --quiet option for fix #4764

merged 8 commits into from
Apr 19, 2023

Conversation

alanmcruickshank
Copy link
Member

This resolves #1834. Another oldie, but perhaps useful for some users. Added a few type hints along the way.

@coveralls
Copy link

coveralls commented Apr 16, 2023

Pull Request Test Coverage Report for Build 4720013971

  • 47 of 47 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 4719563851: 0.0%
Covered Lines: 17845
Relevant Lines: 17845

💛 - Coveralls

@WittierDinosaur
Copy link
Contributor

What's the rationale behind requiring force?

@alanmcruickshank
Copy link
Member Author

alanmcruickshank commented Apr 16, 2023

What's the rationale behind requiring force?

I was thinking that unless there's some output, then you wouldn't know what you were confirming. That means that it would feel a bit strange to ask for confirmation.

If you were a user and used --quiet but not --force what would you expect to happen? I'm very happy to take a different approach on this.

@G3rtjan, as the original poster of the issue, do you have views?

@WittierDinosaur
Copy link
Contributor

i was thinking it'd be along the lines of:

sqlfluff fix --quiet
12 fixable violations found
Confirm fix?

@G3rtjan
Copy link

G3rtjan commented Apr 17, 2023

i was thinking it'd be along the lines of:

sqlfluff fix --quiet
12 fixable violations found
Confirm fix?

Yes, this is what I would expect. It's less verbose compared to the full list of fixes, but still enables a decision (unless you combine it with --force)

@alanmcruickshank
Copy link
Member Author

@WittierDinosaur - I've revised the treatment of --force. With --force you now get:

> sqlfluff fix -d ansi test1.sql --quiet -x f -f
5 fixable linting violations found
== [test1.sql] FIXED

without --force you now get:

> sqlfluff fix -d ansi test1.sql --quiet -x f
5 fixable linting violations found
Are you sure you wish to attempt to fix these? [Y/n] ...
== [test1.sql] FIXED
All Finished � �!

and with -v/--verbose you still get an error:

> sqlfluff fix -d ansi test1.sql --quiet -x f -v
ERROR: The --quiet flag can only be used if --verbose is not set.

Copy link
Contributor

@WittierDinosaur WittierDinosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanmcruickshank alanmcruickshank added this pull request to the merge queue Apr 19, 2023
Merged via the queue into main with commit 93c2f79 Apr 19, 2023
25 checks passed
@alanmcruickshank alanmcruickshank deleted the ac/fix_quiet branch April 19, 2023 08:36
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.

Enable quiet mode/no-verbose in CLI for use in pre-commit hook
4 participants