From 69e118ad45a33bbc639b58dbbf269fc41db534a8 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 7 Aug 2022 10:44:18 +0200 Subject: [PATCH] Add PHP-CS-Fixer Workflow Signed-off-by: DL6ER --- .github/workflows/php-cs-fixer.yml | 13 +++++++++++++ .gitignore | 1 + .php-cs-fixer.dist.php | 29 +++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .github/workflows/php-cs-fixer.yml create mode 100644 .php-cs-fixer.dist.php diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 00000000..68b212ef --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -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 diff --git a/.gitignore b/.gitignore index 259446a0..c8bdf0d6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ TODO *.zip test.html *.log +.php-cs-fixer.cache # Intellij IDEA Project Files *.iml diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..ed220a3a --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +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;