Skip to content
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

sqlfluff does not recognize settings in workplacefolder #165

Open
Jonnokc opened this issue Nov 26, 2024 · 1 comment
Open

sqlfluff does not recognize settings in workplacefolder #165

Jonnokc opened this issue Nov 26, 2024 · 1 comment

Comments

@Jonnokc
Copy link

Jonnokc commented Nov 26, 2024

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.

@CarbonChauvinist
Copy link

@Jonnokc Are you using the "SQL Fix" command from the command prompt? Or are you using the "Format Document"? I ran into the same issue you described when I was using the "SQL Fix" - once I switched over to "Format Document" (making sure I'd selected sqlfluff as the default formatter all worked as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants