From c36f913cfb8aa7322f0ea8940457a8190497d2b3 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Mon, 1 Apr 2019 15:49:55 -0500 Subject: [PATCH] Don't skip style tests for os that have PHP files (#10053) --- scripts/pre-commit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/pre-commit.php b/scripts/pre-commit.php index ff1962b99a..cc193c8462 100755 --- a/scripts/pre-commit.php +++ b/scripts/pre-commit.php @@ -20,6 +20,7 @@ $map = [ 'python' => 0, 'bash' => 0, 'php' => 0, + 'os-php' => 0, 'os' => [], ]; @@ -41,6 +42,9 @@ foreach ($changed_files as $file) { // check if os owned file or generic php file if (!empty($os_name = os_from_file($file))) { $map['os'][] = $os_name; + if (ends_with($file, '.php')) { + $map['os-php']++; + } } elseif (ends_with($file, '.php')) { $map['php']++; } @@ -122,7 +126,7 @@ if (check_opt($options, 'db')) { } // No php files, skip the php checks. -if (!empty($changed_files) && $map['php'] === 0) { +if (!empty($changed_files) && $map['php'] === 0 && $map['os-php'] === 0) { putenv('SKIP_LINT_CHECK=1'); putenv('SKIP_STYLE_CHECK=1'); }