From 226cb11480eafbd79c49751b830a2f12dbc4d039 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Wed, 21 May 2025 16:14:09 +0200 Subject: [PATCH] vscodium: use ruff for python formatting instead of black --- home/modules/vscodium.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/home/modules/vscodium.nix b/home/modules/vscodium.nix index 9678dce..a42b7ec 100644 --- a/home/modules/vscodium.nix +++ b/home/modules/vscodium.nix @@ -16,6 +16,7 @@ with pkgs.vscode-extensions; [ ms-python.python + charliermarsh.ruff vscodevim.vim yzhang.markdown-all-in-one bungcip.better-toml @@ -38,12 +39,6 @@ version = "2023.3.12681020"; sha256 = "sha256-rhed7CQlvxksVCGc9nPU2oYQWtXcAV5TzuG63e8Y3zM="; } - { - name = "black-formatter"; - publisher = "ms-python"; - version = "2023.5.12771008"; - sha256 = "sha256-lJG0RRUUMhQGs2a6oBtoqt+uY1kSJ0+cbmaP07hNh2o="; - } { name = "vscode-pets"; publisher = "tonybaloney"; @@ -90,16 +85,17 @@ "breadcrumbs.showClasses" = true; "breadcrumbs.showFunctions" = true; "gitlens.codeLens.symbolScopes" = [ "!Module" ]; - "editor.defaultFormatter" = "ms-python.black-formatter"; + "editor.defaultFormatter" = "charliermarsh.ruff"; "editor.formatOnSave" = true; }; + "python.experiments.enabled" = false; "python.languageServer" = "Jedi"; # don't use proprietary pylance server "python.defaultInterpreterPath" = "${defaultPython}/bin/python"; - "black-formatter.path" = [ "${pkgs.python3Packages.black}/bin/black" ]; - "black-formatter.importStrategy" = "fromEnvironment"; "mypy-type-checker.path" = [ "${pkgs.python3Packages.mypy}/bin/mypy" ]; "mypy-type-checker.importStrategy" = "fromEnvironment"; "mypy-type-checker.args" = [ "--ignore-missing-imports" ]; + "ruff.path" = [ (lib.getExe pkgs.ruff) ]; + "ruff.importStrategy" = "fromEnvironment"; "gitlens.telemetry.enabled" = false; "vim.highlightedyank.enable" = true; "vim.history" = 500;