Skip to content

format suggests lint-only --disregard-sqlfluffignores option #6818

@acdha

Description

@acdha

Search before asking

  • I searched the issues and found no similar issues.

What Happened

I was testing the latest version on a file which had been ignored while waiting for #901 and got this error message which lead to a confusing situation:

$ sqlfluff format --disregard-sqlfluffignores ¬.sql
==== finding fixable violations ====
WARNING    Exact file path ….sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
==== no fixable linting violations found ====
All Finished 📜 🎉!
$ sqlfluff format --disregard-sqlfluffignores ¬.sql
Usage: sqlfluff format [OPTIONS] [PATHS]...
Try 'sqlfluff format -h' for help.

Error: No such option: --disregard-sqlfluffignores

The cause is simple: --disregard-sqlfluffignores is only declared on the lint subcommand:

@click.option(
"--disregard-sqlfluffignores",
is_flag=True,
help="Perform the operation regardless of .sqlfluffignore configurations",
)

Expected Behaviour

format would work like lint

Observed Behaviour

Error: No such option: --disregard-sqlfluffignores

How to reproduce

Run with a file which is listed in the .sqlfluffignore file.

Dialect

MySQL

Version

sqlfluff, version 3.4.0

Configuration

n/a

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions