Skip to content

Commit 1f19fab

Browse files
committed
feat: ensure backwards compatibility with sqlfluff vscode extension core interface mode
1 parent e3c83de commit 1f19fab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dbt_core_interface/server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ def parse_project(
468468
return ServerResetResult(result="Project re-parsed successfully.")
469469

470470

471+
@app.get("/health") # legacy extension support
471472
@app.get("/api/v1/status")
472473
def status(runner: DbtProject = Depends(_get_runner)) -> dict[str, t.Any]:
473474
"""Health check endpoint to verify server status."""
@@ -507,6 +508,7 @@ class ServerFormatResult(BaseModel):
507508
@app.get("/api/v1/lint")
508509
@app.post("/api/v1/lint")
509510
def lint_sql(
511+
request: Request,
510512
response: Response,
511513
sql_path: str | None = Query(None, description="Path to the SQL file to lint."),
512514
extra_config_path: str | None = Query(None, description="Path to extra SQLFluff config file."),
@@ -546,6 +548,8 @@ def lint_sql(
546548
data={},
547549
)
548550
)
551+
if request.url.path.endswith("/lint"):
552+
return ServerLintResult(result=records[0]["violations"] if len(records) > 0 else [])
549553
return ServerLintResult(result=records) # pyright: ignore[reportArgumentType]
550554

551555

0 commit comments

Comments
 (0)