Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Created August 4, 2023 18:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasaarholt/b90142c0523525e8a47cfd4f95011bd5 to your computer and use it in GitHub Desktop.
Save thomasaarholt/b90142c0523525e8a47cfd4f95011bd5 to your computer and use it in GitHub Desktop.
Helix languages.toml setup for Python with pyright, ruff and black
[[language]]
name = "python"
scope = "source.python"
injection-regex = "python"
file-types = ["py","pyi","py3","pyw",".pythonstartup",".pythonrc"]
shebangs = ["python"]
roots = [".", "pyproject.toml", "pyrightconfig.json"]
comment-token = "#"
language-servers = ["pyright", "ruff"]
indent = { tab-width = 4, unit = " " }
auto-format = true
[language.formatter]
command = "black"
args = [
"-",
"--quiet",
"--line-length=88"
]
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
[language-server.pyright.config]
reportMissingTypeStubs = false
[language-server.pyright.config.python.analysis]
typeCheckingMode = "basic"
autoImportCompletions = true
[language-server.ruff]
command = "ruff-lsp"
[language-server.ruff.config]
settings = {args = []}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment