Skip to content

Commit 8ca6212

Browse files
committed
chore: prevent bad imports from lsp module elsewhere
1 parent 0e8fbdb commit 8ca6212

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,20 @@ select = [
280280
]
281281
extend-select = ["TID"]
282282

283+
283284
[tool.ruff.lint.flake8-tidy-imports]
284285
banned-module-level-imports = [
285286
"duckdb",
286287
"numpy",
287288
"pandas",
288289
]
290+
291+
# Bans imports from sqlmesh.lsp in files outside of sqlmesh/lsp
292+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
293+
"sqlmesh.lsp".msg = "Only files within sqlmesh/lsp can import from sqlmesh.lsp"
294+
295+
[tool.ruff.lint.per-file-ignores]
296+
# TID251 is used to ignore the import of sqlmesh.lsp in files outside sqlmesh/lsp
297+
"sqlmesh/lsp/**/*.py" = ["TID251"]
298+
"tests/lsp/**/*.py" = ["TID251"]
299+
"benchmarks/lsp*.py" = ["TID251"]

0 commit comments

Comments
 (0)