forked from nextcloud/serverinfo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Kesselberg <[email protected]>
- Loading branch information
Showing
5 changed files
with
1,617 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- stable* | ||
|
||
jobs: | ||
php: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['7.2', '7.3', '7.4'] | ||
name: php${{ matrix.php-versions }} | ||
steps: | ||
- name: Checkout | ||
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: Lint | ||
run: "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;" | ||
|
||
php-cs-fixer: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['7.4'] | ||
name: php-cs check | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Set up php | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: none | ||
- name: Install dependencies | ||
run: composer i | ||
- name: Run coding standards check | ||
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*~ | ||
\#* | ||
# PHP Coding Style | ||
vendor/ | ||
.php_cs.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"require-dev": { | ||
"nextcloud/coding-standard": "^0.3.0" | ||
}, | ||
"scripts": { | ||
"cs:check": "php-cs-fixer fix --dry-run --diff", | ||
"cs:fix": "php-cs-fixer fix" | ||
} | ||
} |
Oops, something went wrong.