Skip to content

Commit

Permalink
add flag input vars to composer script and GA problemMatchers
Browse files Browse the repository at this point in the history
  • Loading branch information
n-peugnet committed Jan 15, 2021
1 parent f57f9d5 commit f23f9ad
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/matchers/phpcs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"problemMatcher": [
{
"owner": "phpcs",
"fileLocation": "relative",
"pattern": [
{
"regexp": "^\"(.+)\",(\\d+),(\\d+),(.+),\"(.+)\",(.+),(\\d+),(\\d+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}
16 changes: 16 additions & 0 deletions .github/matchers/phplint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "phplint",
"fileLocation": "relative",
"pattern": [
{
"regexp": "^(.+)\\sin\\s(\\./.+\\.php)\\son\\sline\\s(\\d+)$",
"message": 1,
"file": 2,
"line": 3
}
]
}
]
}
25 changes: 25 additions & 0 deletions .github/matchers/phpunit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"problemMatcher": [
{
"owner": "phpunit",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^\\d+\\)\\s.*$"
},
{
"regexp": "^(.*)$",
"message": 1
},
{
"regexp": "^\\s*$"
},
{
"regexp": "^(.*):(\\d+)$",
"file": 1,
"line": 2
}
]
}
]
}
18 changes: 16 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@ jobs:
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: |
echo "::add-matcher::.github/matchers/phplint.json"
composer install --prefer-dist --no-progress
- name: Run checks
run: composer check
run: |
echo "::add-matcher::.github/matchers/phpcs.json"
echo "::add-matcher::.github/matchers/phpunit.json"
export PHPLINT_FLAGS="--no-progress"
export PHPCS_FLAGS="--report=csv -q"
export PHPSTAN_FLAGS="--no-progress"
composer check
echo "::remove-matcher owner=phpunit::"
echo "::remove-matcher owner=phpcs::"
echo "::remove-matcher owner=phplint::"
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
"fix": [
"@phpcbf"
],
"lint": "parallel-lint --exclude app --exclude var --exclude vendor .",
"phpcs": "phpcs --runtime-set ignore_warnings_on_exit 1",
"lint": "parallel-lint $PHPLINT_FLAGS --exclude app --exclude var --exclude vendor .",
"phpcs": "phpcs $PHPCS_FLAGS --runtime-set ignore_warnings_on_exit 1",
"phpcbf": "phpcbf",
"phpstan": [
"@php bin/console cache:warmup -q",
"phpstan analyse --ansi"
"phpstan analyse $PHPSTAN_FLAGS --ansi"
],
"post-install-cmd": [
"@lint --no-progress",
Expand Down

0 comments on commit f23f9ad

Please sign in to comment.