diff --git a/composer.json b/composer.json index dfaa4cfe1c..600f0a3517 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "friendsofphp/php-cs-fixer": "^3.40" }, "scripts": { - "lint": "php-cs-fixer check --diff", - "lint-fix": "php-cs-fixer fix -v" + "lint": "[ -z \"$(git diff --name-only \"*.php\")\" ] || php-cs-fixer check --diff --config .php-cs-fixer.dist.php $(git diff --name-only \"*.php\")", + "lint-fix": "[ -z \"$(git diff --name-only \"*.php\")\" ] || php-cs-fixer fix -v --config .php-cs-fixer.dist.php $(git diff --name-only \"*.php\")" }, "config": { "platform": {