Add PHP-CS-Fixer Workflow

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2022-08-07 10:44:18 +02:00
parent 94bba3ef9d
commit 69e118ad45
3 changed files with 43 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# .github/workflows/php-cs-fixer.yml
on: [push, pull_request]
name: Lint
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run
+1
View File
@@ -7,6 +7,7 @@ TODO
*.zip
test.html
*.log
.php-cs-fixer.cache
# Intellij IDEA Project Files
*.iml
+29
View File
@@ -0,0 +1,29 @@
<?php
/* Pi-hole: A black hole for Internet advertisements
* (c) 2022 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license.
*/
declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->ignoreDotFiles(false)
->ignoreVCSIgnored(true)
->exclude('scripts/vendor')
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
$config
->setRules(array(
'@PhpCsFixer' => true,
'array_syntax' => array('syntax' => 'long'),
))
->setFinder($finder)
;
return $config;