sqlfluff / vscode-sqlfluff

An extension to use the sqlfluff linter in vscode.
https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff
MIT License
156 stars 33 forks source link

sqlfluff does not recognize settings in workplacefolder #165

Open Jonnokc opened 2 days ago

Jonnokc commented 2 days ago

Within a multi-root workplace and each root folder contains a .vscode/settings.json file, sqlfuff does not recognize any settings defined within when sqlfluff on a file within the associated root workplace.

Instead, sqlfluff appears to only recognize global user defined settings from User/settings.json

Workspace Structure

|-- repo-1 | |-- .venv | | |-- bin | | | |-- sqlfluff | |-- .vscode | | |-- .settings.json | |-- sql | | |-- file_1.sql | | |-- file_2.sql | |-- .sqlfluff

|-- repo-2 | |-- .venv | | |-- bin | | | |-- sqlfluff | |-- .vscode | | |-- .settings.json | |-- sql | | |-- file_3.sql | | |-- file_4.sql | |-- .sqlfluff

A setting.json file could look like the following.

{
"sqlfluff.executablePath": ".venv/bin/sqlfluff",
"sqlfluff.config": ".sqlfluff",
}

Each .settings.json file specifies settings such as path to the config file to use or the executablePath to use. None of these settings are utilized at runtime. No errors are returned. The extension simply uses the device global sqlfluff executable path and no .sqlfluff config file.