Skip to content

Commit

Permalink
add lint check with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
korelstar committed Apr 6, 2021
1 parent e4fba07 commit efc2549
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint
on:
push:
branches:
- master
- stable*
pull_request:

jobs:
lint-php:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
run: composer install --prefer-dist
- name: Load problem matcher for php -l
uses: korelstar/phplint-problem-matcher@v1
- name: PHP syntax check
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
- name: PHP Coding Standards Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
4 changes: 3 additions & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ declare(strict_types=1);

require_once './vendor/autoload.php';

use ChristophWurst\Nextcloud\CodingStandard\Config;
use Nextcloud\CodingStandard\Config;

$config = new Config();
$config
->getFinder()
->ignoreVCSIgnored(true)
->notPath('vendor')
->in(__DIR__);
return $config;

0 comments on commit efc2549

Please sign in to comment.