From 3c40ee1c214868676cbc970e20546973e1505322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 9 May 2025 13:42:45 +0200 Subject: [PATCH] python: Use pyright instead of mypy Right now doesn't wake up in .config/dotfiles for some reason --- hm/dev/python.nix | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/hm/dev/python.nix b/hm/dev/python.nix index 4d9ec18..5ddf404 100644 --- a/hm/dev/python.nix +++ b/hm/dev/python.nix @@ -27,7 +27,7 @@ lint = { select = [ "ALL" ]; ignore = [ - # Things that don't teach me to write better Python + # Things only relevant in proper applications, but not scripts "CPY" # Copyright "D1" # missing docstring "ERA" # commented out code @@ -48,24 +48,17 @@ }; }; }; - nixvim.plugins.lsp.servers.pylsp = { - # Python - enable = config.frogeye.dev.python; - settings.plugins = { - ruff.enabled = true; - pylsp_mypy = { - enabled = true; - overrides = [ - "--cache-dir=${config.xdg.cacheHome}/mypy" - "--ignore-missing-imports" - "--disallow-untyped-defs" - "--disallow-untyped-calls" - "--disallow-incomplete-defs" - "--disallow-untyped-decorators" - true - ]; + nixvim.plugins.lsp.servers = lib.mkIf config.frogeye.dev.python { + ruff.enable = true; + basedpyright = { + enable = true; + settings.basedpyright = { + analysis = { + ignore = [ "*" ]; # Handled by ruff + typeCheckingMode = "standard"; # Should not be an hassle for scripting with untyped libraries + }; + disableOrganizeImports = true; # Handled by ruff }; - # TODO Could add some, could also remove some }; }; };