Configure helix and ruff
- Make helix use ruff-lsp and pyright - Configure ruff to my specifications - Tweak a helix theme color or two
This commit is contained in:
parent
30fee03dd0
commit
ff2faf4e4c
3 changed files with 65 additions and 3 deletions
12
.config/helix/languages.toml
Normal file
12
.config/helix/languages.toml
Normal file
|
@ -0,0 +1,12 @@
|
|||
[[language]]
|
||||
name = "python"
|
||||
roots = ["pyproject.toml"]
|
||||
language-servers = ["pyright", "ruff"]
|
||||
auto-format = true
|
||||
|
||||
[language-server.pyright]
|
||||
command = "pyright-langserver"
|
||||
args = ["--stdio"]
|
||||
|
||||
[language-server.ruff]
|
||||
command = "ruff-lsp"
|
|
@ -18,7 +18,7 @@
|
|||
"ui.text" = "base05"
|
||||
"operator" = "base05"
|
||||
"ui.text.focus" = "base05"
|
||||
"variable" = "base08"
|
||||
"variable" = "base09"
|
||||
"constant.numeric" = "base09"
|
||||
"constant" = "base09"
|
||||
"attribute" = "base09"
|
||||
|
@ -26,12 +26,12 @@
|
|||
"ui.cursor.match" = { fg = "base0A", modifiers = ["underlined"] }
|
||||
"string" = "base0B"
|
||||
"variable.other.member" = "base08"
|
||||
"constant.character.escape" = "base0C"
|
||||
"constant.character.escape" = "base08"
|
||||
"function" = "base0D"
|
||||
"constructor" = "base0D"
|
||||
"special" = "base0D"
|
||||
"keyword" = "base0E"
|
||||
"label" = "base0E"
|
||||
"label" = "base0A"
|
||||
"namespace" = "base0E"
|
||||
"ui.help" = { fg = "base06", bg = "base01" }
|
||||
|
||||
|
|
50
.config/ruff/pyproject.toml
Normal file
50
.config/ruff/pyproject.toml
Normal file
|
@ -0,0 +1,50 @@
|
|||
[tool.ruff]
|
||||
line-length = 120
|
||||
indent-width = 4
|
||||
|
||||
# Dismissed selections:
|
||||
# - CPY: Copyright notice screamer; I don't care
|
||||
# - TD: Overly opinionated on FIXME/TODO format. FIX covers better
|
||||
select = [
|
||||
"ANN", # enforce type annotations
|
||||
"A", # prevent using keywords that clobber python builtins
|
||||
"ARG", # argument usage checking
|
||||
"B", # bugbear: security warnings
|
||||
"C4", # generator usage
|
||||
"C90", # mccabe code complexity
|
||||
"COM", # comma usage
|
||||
"D", # pydocstyle
|
||||
"DTZ", # datetimez sanity
|
||||
"E", # pycodestyle errors
|
||||
"EM", # error message handling
|
||||
"F", # pyflakes - should be enabled but make explicit
|
||||
"ERA", # commented code screamer
|
||||
"FBT", # boolean traps
|
||||
"FIX", # fixme screamer
|
||||
"F", # pyflakes
|
||||
"G", # logging handling
|
||||
"I", # isort
|
||||
"ISC", # implicit string concatenation
|
||||
"PIE", # pie stuff
|
||||
"PL", # pylint rules
|
||||
"PTH", # pathlib usage
|
||||
"Q", # quote handling
|
||||
"RET", # return handling
|
||||
"RUF", # the ruff developer's own rules
|
||||
"SIM", # simplification options
|
||||
"UP", # alert you when better syntax is available in your python version
|
||||
"W", # pycodestyle warnings
|
||||
]
|
||||
|
||||
ignore = [
|
||||
"ANN101", # No type hint for "self" - not necessary and makes noisy code
|
||||
"D211", # No line before class, incompatible with D203 - one line before class
|
||||
"D212", # Summary on first line; incompatible with D213 - summary on second line
|
||||
"D400" # Summary should end with period - duplicates D415 - summary ends with punctuation
|
||||
]
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "double"
|
||||
indent-style = "space"
|
||||
skip-magic-trailing-comma = false
|
||||
|
Loading…
Add table
Reference in a new issue