Skip to content

Commit 886598f

Browse files
authored
chore: prevent bad imports from lsp module elsewhere (#5000)
1 parent 0e8fbdb commit 886598f

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy