Browse Source
Add PHP CS
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/3329/head
Joas Schilling
6 years ago
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
6 changed files with
1600 additions and
0 deletions
-
.github/workflows/lint.yml
-
.gitignore
-
.php_cs.dist
-
Makefile
-
composer.json
-
composer.lock
|
|
|
@ -28,6 +28,29 @@ jobs: |
|
|
|
- name: Lint |
|
|
|
run: "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;" |
|
|
|
|
|
|
|
php-cs: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
|
|
strategy: |
|
|
|
matrix: |
|
|
|
php-versions: ['7.4'] |
|
|
|
|
|
|
|
name: php${{ matrix.php-versions }} CS |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
|
|
|
- name: Set up php ${{ matrix.php-versions }} |
|
|
|
uses: shivammathur/setup-php@v1 |
|
|
|
with: |
|
|
|
php-version: ${{ matrix.php-versions }} |
|
|
|
coverage: none |
|
|
|
|
|
|
|
- name: Composer |
|
|
|
run: composer install |
|
|
|
|
|
|
|
- name: Check CS |
|
|
|
run: composer run cs:check |
|
|
|
|
|
|
|
node: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
|
|
|
|
|
|
@ -14,3 +14,7 @@ tests/integration/vendor |
|
|
|
tests/integration/output |
|
|
|
|
|
|
|
js |
|
|
|
|
|
|
|
# PHP Coding Style |
|
|
|
vendor/ |
|
|
|
.php_cs.cache |
|
|
|
@ -0,0 +1,18 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
declare(strict_types=1); |
|
|
|
|
|
|
|
require_once './vendor/autoload.php'; |
|
|
|
|
|
|
|
use Nextcloud\CodingStandard\Config; |
|
|
|
|
|
|
|
$config = new Config(); |
|
|
|
$config |
|
|
|
->getFinder() |
|
|
|
->ignoreVCSIgnored(true) |
|
|
|
->notPath('build') |
|
|
|
->notPath('l10n') |
|
|
|
->notPath('src') |
|
|
|
->notPath('vendor') |
|
|
|
->in(__DIR__); |
|
|
|
return $config; |
|
|
|
@ -61,6 +61,8 @@ appstore: |
|
|
|
--exclude=babel.config.js \
|
|
|
|
--exclude=/build \
|
|
|
|
--exclude=check-vuejs-builds.sh \
|
|
|
|
--exclude=composer.json \
|
|
|
|
--exclude=composer.lock \
|
|
|
|
--exclude=docs \
|
|
|
|
--exclude=.drone.yml \
|
|
|
|
--exclude=.eslintignore \
|
|
|
|
@ -76,12 +78,14 @@ appstore: |
|
|
|
--exclude=node_modules \
|
|
|
|
--exclude=package.json \
|
|
|
|
--exclude=package-lock.json \
|
|
|
|
--exclude=.php_cs.dist \
|
|
|
|
--exclude=README.md \
|
|
|
|
--exclude=run-*lint.sh \
|
|
|
|
--exclude=src \
|
|
|
|
--exclude=.stylelintignore \
|
|
|
|
--exclude=.stylelintrc \
|
|
|
|
--exclude=tests \
|
|
|
|
--exclude=vendor \
|
|
|
|
--exclude=webpack.*.js \
|
|
|
|
$(project_dir)/ $(sign_dir)/$(app_name) |
|
|
|
@if [ -f $(cert_dir)/$(app_name).key ]; then \
|
|
|
|
|
|
|
|
@ -0,0 +1,9 @@ |
|
|
|
{ |
|
|
|
"scripts": { |
|
|
|
"cs:check": "php-cs-fixer fix --dry-run --diff", |
|
|
|
"cs:fix": "php-cs-fixer fix" |
|
|
|
}, |
|
|
|
"require-dev": { |
|
|
|
"nextcloud/coding-standard": "^0.3.0" |
|
|
|
} |
|
|
|
} |