Skip to content

Commit b5c8a04

Browse files
authored
Add pint workflow - Auto fix styling (#999)
1 parent f789933 commit b5c8a04

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ tests export-ignore
22
.gitattributes export-ignore
33
.github export-ignore
44
.gitignore export-ignore
5+
.pint.json export-ignore
56
.scrutinizer.yml export-ignore
67
.styleci.yml export-ignore
78
.travis.yml export-ignore
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
jobs:
9+
php-code-styling:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.head_ref }}
17+
18+
- name: Fix PHP code style issues
19+
uses: aglipanci/laravel-pint-action@v2
20+
with:
21+
configPath: ".pint.json"
22+
23+
- name: Commit changes
24+
uses: stefanzweifel/git-auto-commit-action@v5
25+
with:
26+
commit_message: Fix styling

.pint.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"preset": "laravel",
3+
"verbose": false,
4+
"test": false,
5+
"dry": false,
6+
"ignore": [
7+
"vendor"
8+
],
9+
"remove": [],
10+
"config": {
11+
"braces": {
12+
"allow_single_line_closure": true
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)