Using SQLFluff to lint and format SQL codes.
Examples:
sqlfluff lint --dialect postgres .
sqlfluff fix --dialect tsql src/test.sql
Further: CLI Reference
SQLFluff accepts configuration either through the command line or through configuration files. For file based configuration SQLFluff will look for the following files in order. Later files will (if found) will be used to overwrite any values read from earlier files.
setup.cfg
tox.ini
pep8.ini
.sqlfluff
pyproject.toml
pip install sqlfluff
2. Add config file like .sqlfluff
sqlfluff lint **/*.sql
sqlfluff fix **/*.sql
On the basis of Rolling out SQLFluff with a new team, added the workflow test.
We check the SQL lint using the workflow file: sql_lint.yml
Refer: PR