diff --git a/hm/dev/python.nix b/hm/dev/python.nix index 088fdc5..d03e511 100644 --- a/hm/dev/python.nix +++ b/hm/dev/python.nix @@ -12,47 +12,48 @@ python3Packages.ipython ]; sessionVariables = { - PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py"; + PYTHONSTARTUP = ./pythonstartup.py; }; }; - programs.bash.shellAliases = { - ipython = "ipython --no-confirm-exit --pdb"; - }; - programs.nixvim.plugins.lsp.servers.pylsp = { - # Python - enable = config.frogeye.dev.python; - settings.plugins = { - black.enabled = true; - flake8 = { - enabled = true; - maxLineLength = 88; # Compatibility with Black - }; - isort.enabled = true; - mccabe.enabled = true; - pycodestyle = { - enabled = true; - maxLineLength = 88; # Compatibility with Black - }; - pyflakes.enabled = true; - pylint.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 - ]; - }; - # TODO Could add some, could also remove some + programs = { + bash.shellAliases = { + ipython = "ipython --no-confirm-exit --pdb"; }; - }; - xdg.configFile = { - "pythonstartup.py" = { - text = (builtins.readFile ./pythonstartup.py); + ruff = { + enable = true; + settings = { + lint = { + select = [ + # Original + "F" # pyflakes + "I" # isort + "C90" # mccabe (complexity) + "E" # pycodestyle error + "W" # pycodestyle warning + "PL" # pylint + ]; + }; + }; + }; + 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 + ]; + }; + # TODO Could add some, could also remove some + }; }; }; };