diff --git a/Makefile b/Makefile index 0f73c2498..24cbc6f3b 100644 --- a/Makefile +++ b/Makefile @@ -362,14 +362,10 @@ lint-exec: .endif .endfor +LINTBIN?= ${.CURDIR}/contrib/parallel-lint/parallel-lint + lint-php: - @find ${.CURDIR}/src \ - ! -name "*.xml" ! -name "*.xml.sample" ! -name "*.eot" \ - ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \ - ! -name "*.otf" ! -name "*.png" ! -name "*.js" \ - ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" \ - ! -name "*.tgz" ! -name "*.xml.dist" ! -name "*.tgb" \ - -type f -print0 | xargs -0 -n1 php -l + @${LINTBIN} src lint: plist-check lint-shell lint-xml lint-exec lint-php diff --git a/contrib/parallel-lint/src/Manager.php b/contrib/parallel-lint/src/Manager.php index 84b743406..40b9c7a24 100644 --- a/contrib/parallel-lint/src/Manager.php +++ b/contrib/parallel-lint/src/Manager.php @@ -140,7 +140,7 @@ class Manager protected function getFilesFromPaths(array $paths, array $extensions, array $excluded = array()) { $extensions = array_map('preg_quote', $extensions, array_fill(0, count($extensions), '`')); - $regex = '`\.(?:' . implode('|', $extensions) . ')$`iD'; + $regex = count($extensions) ? '`\.(?:' . implode('|', $extensions) . ')$`iD' : '`.+`iD'; $files = array(); foreach ($paths as $path) { diff --git a/contrib/parallel-lint/src/Settings.php b/contrib/parallel-lint/src/Settings.php index 40cb8b179..cea565f55 100644 --- a/contrib/parallel-lint/src/Settings.php +++ b/contrib/parallel-lint/src/Settings.php @@ -44,7 +44,7 @@ class Settings * If path contains directory, only file with these extensions are checked * @var array */ - public $extensions = array('php', 'phtml', 'php3', 'php4', 'php5', 'phpt'); + public $extensions = array(); /** * Array of file or directories to check