mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Only have Scrutinizer check PHP files
This commit is contained in:
parent
99da5cd198
commit
4cb98f1afd
@ -3,3 +3,5 @@ tools:
|
|||||||
-
|
-
|
||||||
scope: file
|
scope: file
|
||||||
command: php tests/phpcs_runner.php %pathname%
|
command: php tests/phpcs_runner.php %pathname%
|
||||||
|
filter:
|
||||||
|
excluded_paths: ["*/css/*", "css/*", "thirdparty/*", "*/jquery-changetracker/*", "parsers/HTML/BBCodeParser/*", "*/SSTemplateParser.php$"]
|
||||||
|
@ -12,6 +12,10 @@ if(!empty($_SERVER['argv'][1])) {
|
|||||||
|
|
||||||
$result = array('comments' => array());
|
$result = array('comments' => array());
|
||||||
|
|
||||||
|
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
|
// Whitelist of extensions to check (default phpcs list)
|
||||||
|
if(in_array($extension, array('php', 'js', 'inc', 'css'))) {
|
||||||
// Run each sniff
|
// Run each sniff
|
||||||
|
|
||||||
// phpcs --encoding=utf-8 --standard=framework/tests/phpcs/tabs.xml
|
// phpcs --encoding=utf-8 --standard=framework/tests/phpcs/tabs.xml
|
||||||
@ -19,7 +23,7 @@ run_sniff('tabs.xml', $path, $result);
|
|||||||
|
|
||||||
// phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs/ruleset.xml
|
// phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs/ruleset.xml
|
||||||
run_sniff('ruleset.xml', $path, $result, '--tab-width=4');
|
run_sniff('ruleset.xml', $path, $result, '--tab-width=4');
|
||||||
|
}
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
|
|
||||||
function run_sniff($standard, $path, array &$result, $extraFlags = '') {
|
function run_sniff($standard, $path, array &$result, $extraFlags = '') {
|
||||||
|
Loading…
Reference in New Issue
Block a user