From 13cee7793781f3137067c77b00aac7c9595fe7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Reyrol?= Date: Sat, 26 Aug 2023 02:31:21 +0200 Subject: [PATCH] hooks: add psalm --- README.md | 1 + modules/hooks.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 0f4f4449..dce27912 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ use nix - [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer) - [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) - [phpstan](https://github.com/phpstan/phpstan) +- [psalm](https://github.com/vimeo/psalm) ## Rust diff --git a/modules/hooks.nix b/modules/hooks.nix index 802c4053..537b57fc 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -436,6 +436,19 @@ in }; }; + psalm = + { + binPath = + mkOption { + type = types.str; + description = lib.mdDoc "Psalm binary path."; + default = "${pkgs.php82Packages.psalm}/bin/psalm"; + defaultText = lib.literalExpression '' + "''${pkgs.php81Packages.phpstan}/bin/psalm" + ''; + }; + }; + pylint = { binPath = @@ -1561,6 +1574,15 @@ in types = [ "php" ]; }; + psalm = + { + name = "psalm"; + description = "Static Analysis of PHP files."; + entry = with settings.psalm; + "${binPath}"; + types = [ "php" ]; + }; + pylint = {