Skip to content

Commit 50df875

Browse files
committed
fix: php lint
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent e580563 commit 50df875

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

.github/workflows/lint.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
# SPDX-FileCopyrightText: 2026 LibreSign
22
# SPDX-License-Identifier: AGPL-3.0-or-later
33

4-
name: lint
4+
name: Lint php
55

6-
on:
7-
pull_request:
8-
push:
9-
branches: [main]
6+
on: pull_request
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: lint-php-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
1014

1115
jobs:
12-
lint:
16+
php-lint:
1317
runs-on: ubuntu-latest
18+
name: php-lint
19+
1420
steps:
15-
- uses: actions/checkout@v6
21+
- name: Checkout
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
persist-credentials: false
1625
- name: Detect minimum PHP from composer.json
1726
id: php_min
1827
run: |
@@ -22,6 +31,6 @@ jobs:
2231
- uses: shivammathur/setup-php@v2
2332
with:
2433
php-version: ${{ steps.php_min.outputs.version }}
25-
- run: composer install --no-interaction --prefer-dist
26-
- run: composer bin all install --no-interaction --prefer-dist
27-
- run: composer lint
34+
35+
- name: Lint
36+
run: composer run php:lint

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@
4545
},
4646
"scripts": {
4747
"lint": [
48+
"@php:lint",
4849
"@cs:check",
4950
"@rector:check",
5051
"@psalm",
5152
"@duplication:check",
5253
"@composer:validate"
5354
],
55+
"php:lint": "find . -type f -name '*.php' -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
5456
"cs:check": "vendor-bin/phpcs/vendor/squizlabs/php_codesniffer/bin/phpcs -q",
5557
"cs:fix": "vendor-bin/phpcs/vendor/squizlabs/php_codesniffer/bin/phpcbf -q",
5658
"rector:check": "vendor-bin/rector/vendor/rector/rector/bin/rector process --dry-run",

0 commit comments

Comments
 (0)