Where Does SQLFluff Look for Config Files?
SQLFluff layers config from its app directory, your home folder, and the project tree, with the closest .sqlfluff file winning.
Last updated
SQLFluff needs no config file to run, which confuses people when they add one and nothing changes. It builds its final settings by layering files from general to specific: first the OS app config directory, then your home folder, then each directory down to the file being linted. Closer files patch over farther ones.
For personal defaults across every project, use the app config directory. For project rules the team shares, commit a .sqlfluff file at the repo root. Anything deeper than that should only hold narrow overrides for one folder of queries.
Where SQLFluff stores this, by platform
%LOCALAPPDATA%\sqlfluff
Holds any of the five config filenames and acts as your personal default layer. Project files in the repo override everything here, which is exactly the split you want.
~/.config/sqlfluff
Same role as on Windows. A .sqlfluff file here sets your personal dialect and rules everywhere, while checked in project files still win per repo.
~/.config/sqlfluff
Identical lookup order to macOS. Check the home directory and every directory between home and the linted file when a setting surprises you.
Frequently asked questions
Which filenames does SQLFluff actually read?
Name it .sqlfluff, setup.cfg, tox.ini, or pep8.ini for ini style config, or put a sqlfluff tool table in pyproject.toml. Later filenames in that list override earlier ones found in the same directory.
My config seems ignored. What should I check?
Two usual causes. The templater setting cannot be set in subdirectory configs, and a file in a closer directory silently overrides the one you edited. Run lint with verbose output to see which files it loaded.
Notice an outdated path? Let us know.