Added action to check style

This commit is contained in:
Leo Lu 2020-06-25 20:47:22 +08:00 committed by billchenchina
parent b8f82be3dc
commit 4488004d72
4 changed files with 31 additions and 0 deletions

12
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,12 @@
on: [push, pull_request]
name: Main
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=./web/.php_cs --diff --dry-run

2
web/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea
.php_cs.cache

17
web/.php_cs Normal file
View File

@ -0,0 +1,17 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
;
return PhpCsFixer\Config::create()
->setIndent("\t")
->setRules([
'braces'=>[
'position_after_functions_and_oop_constructs'=>'same'
],
'elseif' => true
])
->setFinder($finder)
;

BIN
web/app/vendor/bin/php-cs-fixer vendored Executable file

Binary file not shown.