From fb22debb36bb9c25ac89a890e352e5d2e61715be Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 13 Nov 2022 15:20:23 +0000 Subject: [PATCH] null-ls: add black formatter --- plugins/null-ls/servers.nix | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/null-ls/servers.nix b/plugins/null-ls/servers.nix index b554077f34..476dde2666 100644 --- a/plugins/null-ls/servers.nix +++ b/plugins/null-ls/servers.nix @@ -2,11 +2,12 @@ let helpers = import ./helpers.nix args; serverData = { - code_actions = { - }; - completion = { - }; + code_actions = { }; + completion = { }; diagnostics = { + flake8 = { + packages = [ pkgs.python3Packages.flake8 ]; + }; }; formatting = { phpcbf = { @@ -21,8 +22,8 @@ let prettier = { packages = [ pkgs.nodePackages.prettier ]; }; - flake8 = { - packages = [ pkgs.python3Packages.flake8 ]; + black = { + packages = [ pkgs.python3Packages.black ]; }; }; }; @@ -32,9 +33,11 @@ let # sourceType = "formatting"; # packages = [...]; # }] - serverDataFormatted = lib.mapAttrsToList (sourceType: sourceSet: - lib.mapAttrsToList (name: attrs: attrs // { inherit sourceType name; }) sourceSet - ) serverData; + serverDataFormatted = lib.mapAttrsToList + (sourceType: sourceSet: + lib.mapAttrsToList (name: attrs: attrs // { inherit sourceType name; }) sourceSet + ) + serverData; dataFlattened = lib.flatten serverDataFormatted; in {