Closed wtfzambo closed 11 months ago
The check=true config in your file prevents changes from being written to the file. Remove that config for the behavior you want.
The check=true config in your file prevents changes from being written to the file. Remove that config for the behavior you want.
AH there you go, I knew I was being stupid somewhere. Thanks! Sorry for opening a stupid issue.
Describe the bug I run
sqlfmt myfile.sql
orsqlfmt .
from the CLI, and even if it can detect that a file needs formatting, it doesn't automatically apply it. Works ok when running in tandem with dbt-power-user and set as format when "format on save" is on.If I run:
the output is:
However,
--diff
works fine and properly shows the rows it would change.To Reproduce I'm in a pretty standard bread and butter dbt project, running in a devcontainer:
pyproject.toml
Expected behavior sqlfmt actually formats files in place when called from the CLI.
Actual behavior sqlfmt detects files that need formatting, but doesn't change them.
Additional context What is the output of
sqlfmt --version
?