You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line_length configuration set in a pyproject.toml file is taken into consideration by the sqlfmt brought by dbt power user.
Actual behavior
The line_length configuration set in a pyproject.toml file is taken into consideration by the sqlfmt brought by dbt power user.
Steps To Reproduce
Create a project with dbt init, add a pyproject.toml file with this content at the root of the project
[tool.sqlfmt]
line_length = 120
Create a model containing the following line and save it in models/example/test.sql
-- test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
with dbt power user installed, format the file with the VSCode shortcut, the line is truncated at char 83 (unexpected behaviour)
from the root of the project run sqlfmt models/example/my_second_dbt_model.sql, the line is truncated at char 118 (expected behaviour)
Notice that in the docs of sqlfmt it is mentioned that
sqlfmt will search for the pyproject.toml file using the files passed to it as arguments. It starts in the lowest (most
specific) common parent directory to all the files and recurses up to the root directory. It will load settings from the first pyproject.toml file it finds in this search.
The behaviour is fairly annoying for my team since we have a pre-commit that uses sqlfmt to check the formatting based on the pyproject.toml file. It would be amazing if dbt power user could use by default the same configuration specified in pyproject.toml without the need to modify the settings 🙏
Log output/Screenshots
No response
Operating System
macOS 14.5 (23F79)
dbt version
1.7.17
dbt Adapter
bigquery
dbt Power User version
v0.42.3
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
I have the same issue in v0.44.2, and this is annoying.
To config, I have to edit sqlfmt arguments in the extension instead of having it read the pyproject.toml.
This forces one's editor preference into settings for the whole team.
Expected behavior
The
line_length
configuration set in a pyproject.toml file is taken into consideration by the sqlfmt brought by dbt power user.Actual behavior
The
line_length
configuration set in a pyproject.toml file is taken into consideration by the sqlfmt brought by dbt power user.Steps To Reproduce
dbt init
, add apyproject.toml
file with this content at the root of the projectmodels/example/test.sql
with dbt power user installed, format the file with the VSCode shortcut, the line is truncated at char 83 (unexpected behaviour)
from the root of the project run
sqlfmt models/example/my_second_dbt_model.sql
, the line is truncated at char 118 (expected behaviour)Notice that in the docs of sqlfmt it is mentioned that
The behaviour is fairly annoying for my team since we have a pre-commit that uses sqlfmt to check the formatting based on the pyproject.toml file. It would be amazing if dbt power user could use by default the same configuration specified in pyproject.toml without the need to modify the settings 🙏
Log output/Screenshots
No response
Operating System
macOS 14.5 (23F79)
dbt version
1.7.17
dbt Adapter
bigquery
dbt Power User version
v0.42.3
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: