Skip to content

Commit 0c26789

Browse files
committed
Merge pull request #1 from LycheeOrg/more-rules
1 parent 14e5e57 commit 0c26789

File tree

6 files changed

+1068
-3192
lines changed

6 files changed

+1068
-3192
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ trim_trailing_whitespace = false
2020
[*.js]
2121
indent_style = tab
2222
indent_size = 4
23+
24+
[*.yml]
25+
indent_style = space
26+
indent_size = 2

.github/workflows/test-impact.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Test Impact
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on:
5+
push:
6+
paths-ignore:
7+
- '**/*.md'
8+
pull_request:
9+
paths-ignore:
10+
- '**/*.md'
11+
# Allow manually triggering the workflow.
12+
workflow_dispatch:
13+
14+
jobs:
15+
kill_previous:
16+
name: 0️⃣ Kill previous runs
17+
runs-on: ubuntu-latest
18+
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
19+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
20+
steps:
21+
- name: Cancel Previous Runs
22+
uses: styfle/[email protected]
23+
with:
24+
access_token: ${{ github.token }}
25+
26+
execute_Lychee:
27+
name: 1️⃣ PHP - Lychee
28+
runs-on: ubuntu-latest
29+
needs:
30+
- kill_previous
31+
steps:
32+
- name: Extract branch name
33+
shell: bash
34+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
35+
id: extract_branch
36+
37+
- name: Set up PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: 8.0
41+
coverage: none
42+
tools: phpstan
43+
env:
44+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Checkout code
47+
uses: actions/checkout@v3
48+
with:
49+
repository: 'LycheeOrg/Lychee'
50+
51+
- name: Fix composer.json
52+
run: composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}"
53+
54+
- name: Run PHPStan
55+
run: vendor/bin/phpstan analyze
56+
57+
execute_php_exif:
58+
name: 1️⃣ PHP - php-exif
59+
runs-on: ubuntu-latest
60+
needs:
61+
- kill_previous
62+
steps:
63+
- name: Extract branch name
64+
shell: bash
65+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
66+
id: extract_branch
67+
68+
- name: Set up PHP
69+
uses: shivammathur/setup-php@v2
70+
with:
71+
php-version: 8.0
72+
coverage: none
73+
tools: phpstan
74+
env:
75+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Checkout code
78+
uses: actions/checkout@v3
79+
with:
80+
repository: 'LycheeOrg/php-exif'
81+
82+
- name: Fix composer.json
83+
run: composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}"
84+
85+
- name: Run PHPStan
86+
run: vendor/bin/phpstan analyze
87+
88+
execute_nested_sets:
89+
if: ${{ false }} # disable for now
90+
name: 1️⃣ PHP - Nested sets
91+
runs-on: ubuntu-latest
92+
needs:
93+
- kill_previous
94+
steps:
95+
- name: Extract branch name
96+
shell: bash
97+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
98+
id: extract_branch
99+
100+
- name: Set up PHP
101+
uses: shivammathur/setup-php@v2
102+
with:
103+
php-version: 8.0
104+
coverage: none
105+
tools: phpstan
106+
env:
107+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
109+
- name: Checkout code
110+
uses: actions/checkout@v3
111+
with:
112+
repository: 'LycheeOrg/laravel-nestedset'
113+
ref: 'enable-phpstan'
114+
115+
- name: Fix composer.json
116+
run: |
117+
composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}"
118+
119+
- name: Run PHPStan
120+
run: vendor/bin/phpstan analyze

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
"ergebnis/phpstan-rules": "^1.0",
88
"friendsofphp/php-cs-fixer": "^3.3",
99
"php-parallel-lint/php-parallel-lint": "^1.2",
10+
"phpstan/phpstan": "^1.7",
1011
"phpstan/phpstan-deprecation-rules": "^1.0",
1112
"phpstan/phpstan-strict-rules": "^1.3",
12-
"phpstan/phpstan": "^1.7",
1313
"slam/phpstan-extensions": "^6.0",
1414
"squizlabs/php_codesniffer": "^3.5",
15+
"symplify/phpstan-rules": "^11.0",
1516
"thecodingmachine/phpstan-safe-rule": "^1.2"
1617
},
1718
"scripts": {

0 commit comments

Comments
 (0)