-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use extension in multiple dbt projects inside a single devcontainer #83
Comments
I think it would be possible to get the extension to work on all projects, but I have not tested this before so I am not sure. Your best bet would be to remove the The linting performance is not too good, especially when linting with the dbt templater. I have not done any work in the sqlfluff repository, I just work on this extension. You would have to look at that repository for any performance concerns. This extension basically just runs the sqlfluff command and shows that output in VSCode. Let me know if you are able to get your project working with my suggestions. |
Hi @RobertOstermann , i tried your config proposal:
But it failed with the following error (taken out of the output terminal for sqlfluff):
Any idea how to solve this? |
@ggmblr I think this error occurs whenever the program is unable to find the sqlfluff executable. Though I also would not have expected that file path to be going up directories to find the file. You should try running the It is possible that you just need to update your Did you have this extension working before updating the |
@RobertOstermann I tried running the command in various directories manually and it didn't work. The error message was always
So i tried removing the
Running the execution command inside the terminal either yields the same error message when run in a parent directory, or With my previous config (which didn't include the
My next test is to combine both configs, have
While the output is the following:
So what you mention about Thanks again for your help. |
@ggmblr Looking at it again I don't think it is an issue with your executable path. I think it was an issue with the variables not working correctly in the workingDirectory setting. Could you upgrade to v2.2.3 and try these settings. Let me know if this works for you. //"sqlfluff.config": "${workspaceFolder}/dbt-snowflake/.sqlfluff",
"sqlfluff.workingDirectory": "${fileDirname}",
"sqlfluff.dialect": "snowflake",
"sqlfluff.executablePath": "/usr/local/bin/sqlfluff",
"sqlfluff.format.enabled": true,
// I think you need this to be false to pick up your configuration files.
"sqlfluff.ignoreLocalConfig": false,
"sqlfluff.ignoreParsing": false,
"sqlfluff.linter.run": "onSave",
"sqlfluff.experimental.format.executeInTerminal": true,
"editor.formatOnSave": false,
"[sql]": {
"editor.defaultFormatter": "dorzey.vscode-sqlfluff"
} |
@RobertOstermann Using the suggested config with v2.2.3 results in the following output:
Which suggests that it is not able to read my config for sqlfluff, which is set with
|
Ok, I am about out of ideas. One last thing you could try would be removing the "sqlfluff.dialect": "snowflake",
"sqlfluff.executablePath": "/usr/local/bin/sqlfluff",
"sqlfluff.format.enabled": true,
"sqlfluff.ignoreLocalConfig": false,
"sqlfluff.ignoreParsing": false,
"sqlfluff.linter.run": "onSave",
"sqlfluff.experimental.format.executeInTerminal": true,
"editor.formatOnSave": false,
"[sql]": {
"editor.defaultFormatter": "dorzey.vscode-sqlfluff"
} If that doesn't work you would have to find some consistent way of calling SQLFluff from the terminal that works for your different cases. This extension is fairly configurable so if you are able to find something that works I don't think it would be too difficult to set up with the available settings. |
Hi, I'm trying to set up a devcontainer in vscode to allow for a reproducible dev environment for our data team. Since we work on more than a single project, the root directory (or workspace) i'm opening contains a number of projects, some of which are dbt projects
See an example of our workspace:
In each of the dbt-snowflake projects we have a
.sqlfluff
config file that looks more or less like this:This ensures that in a vacuum sqlfluff works inside each project, but we only get the vscode extension to work on a single project, which is the one for which we configure the
"sqlfluff.config"
In the
devcontainer.json
we have the following config for sqlfluff (as we see here we configure the config path to be the one inside project 1):Now i have a couple of questions:
Is it possible for us to get the extension to work on all projects inside a single devcontainer? Meaning, we want to be able to work on a
.sql
file inside whichever dbt project and get it linted on save.On the other hand what is the expected performance for the linting? I feel like it consumes a lot of resources and takes a considerable amount of time, probably because or projects are large and the compilation takes a lot of time. Do subsequent lintings use partial parsing?
Feel free to request more details or give us tips on best practices or how to properly configure such a dev environment/container.
Many thanks.
The text was updated successfully, but these errors were encountered: