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;