sqlfluff icon indicating copy to clipboard operation
sqlfluff copied to clipboard

Support `.sqlfluffignore` configuration in `pyproject.toml`

Open aaaaahaaaaa opened this issue 2 years ago • 3 comments

Search before asking

  • [X] I searched the issues and found no similar issues.

Description

In the spirit of reducing the number of config files required, it would be great if the sqlfluffignore configuration could be supported in pyproject.toml.

Use case

No response

Dialect

pyproject.toml configuration

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

aaaaahaaaaa avatar Feb 02 '24 12:02 aaaaahaaaaa

This is definitely possible, and would also open up the option of specifying ignore options in the .sqlfluff file too. By setting up one we would do almost all of the work to set up the other.

My initial suggestion is that this would be it's actually just a new key in the top line config, something like:

[sqlfluff]
ignore_files =
    foo.sql
    bar.sql

or

[tool.sqlfluff.core]
ignore_files = [
    "foo.sql",
    "bar.sql",
]

How does that sound?

alanmcruickshank avatar Mar 12 '24 21:03 alanmcruickshank

Sounds perfect

aaaaahaaaaa avatar Mar 12 '24 22:03 aaaaahaaaaa

This is definitely possible, and would also open up the option of specifying ignore options in the .sqlfluff file too. By setting up one we would do almost all of the work to set up the other.

My initial suggestion is that this would be it's actually just a new key in the top line config, something like:

[sqlfluff]
ignore_files =
    foo.sql
    bar.sql

or

[tool.sqlfluff.core]
ignore_files = [
    "foo.sql",
    "bar.sql",
]

How does that sound?

In our project we ignore entire directories like

#.sqlfluffignore
dbt_modules/
dbt_packages/

so calling it ignore_files files could be a bit confusing. How about ignore_paths?

frehoy avatar Mar 26 '24 11:03 frehoy