make: use slight modify for checking all potential files

This commit is contained in:
Franco Fichtner 2021-10-05 08:45:43 +02:00
parent 062d51889e
commit 14b46feee2
3 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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