Skip to content

Commit

Permalink
hooks: add phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelreyrol committed Aug 26, 2023
1 parent 7e3517c commit 108539f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ use nix
- [php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
- [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer)
- [phpcs](https://github.com/squizlabs/PHP_CodeSniffer)
- [phpstan](https://github.com/phpstan/phpstan)

## Rust

Expand Down
22 changes: 22 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,19 @@ in
};
};

phpstan =
{
binPath =
mkOption {
type = types.str;
description = lib.mdDoc "PHPStan binary path.";
default = "${pkgs.php82Packages.phpstan}/bin/phpstan";
defaultText = lib.literalExpression ''
"''${pkgs.php81Packages.phpstan}/bin/phpstan"
'';
};
};

php-cs-fixer =
{
binPath =
Expand Down Expand Up @@ -1530,6 +1543,15 @@ in
types = [ "php" ];
};

phpstan =
{
name = "phpstan";
description = "Static Analysis of PHP files.";
entry = with settings.phpstan;
"${binPath} analyse";
types = [ "php" ];
};

php-cs-fixer =
{
name = "php-cs-fixer";
Expand Down

0 comments on commit 108539f

Please sign in to comment.