Skip to content

Commit 27ae18a

Browse files
committed
Add PHP lint problem matcher
Signed-off-by: John Rayes <live627@gmail.com>
1 parent 006987c commit 27ae18a

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

.github/phplint-matcher.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "phplint-matcher",
5+
"pattern": [
6+
{
7+
"regexp": "^(.+):\\s+\\s+(.+) in (.+) on line (\\d+)$",
8+
"code": 1,
9+
"message": 2,
10+
"file": 3,
11+
"line": 4
12+
}
13+
]
14+
}
15+
]
16+
}

.github/workflows/Syntax-Check.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: PHP Syntax Check
22

33
on:
44
push:
5-
branches: [ smf21, master ]
65
pull_request:
76
branches: [ smf21, master ]
87

@@ -19,9 +18,16 @@ jobs:
1918
- uses: actions/checkout@master
2019
with:
2120
submodules: false
21+
- name: Add PHP lint matcher
22+
run: echo "::add-matcher::.github/phplint-matcher.json"
2223
- name: Setup PHP
2324
id: SetupPHP
2425
uses: nanasess/setup-php@master
2526
with:
2627
php-version: ${{ matrix.php }}
27-
- run: php ./.github/scripts/check-php-syntax.php ./
28+
- name: Lint PHP files
29+
run: |
30+
shopt -s globstar
31+
for f in **/*.php; do
32+
php -l "$f"
33+
done

0 commit comments

Comments
 (0)