Skip to content

Commit d5e8235

Browse files
committed
Add code linting using Laravel Pint
1 parent e4f95b6 commit d5e8235

6 files changed

Lines changed: 84 additions & 26 deletions

File tree

.github/workflows/composer.test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
run: docker compose exec -e APP_ENV=testing -T api vendor/bin/phpunit
5151
- name: Psalm
5252
run: docker compose exec -T api vendor/bin/psalm
53+
- name: Linting
54+
run: docker compose exec api vendor/bin/pint --test -v
5355

5456
- name: Run elasticsearch index deletion integration test
5557
run: docker compose exec -e RUN_PHPUNIT_INTEGRATION_TEST=1 -e ELASTICSEARCH_HOST=elasticsearch.svc:9200 -T api vendor/bin/phpunit tests/Jobs/Integration/ElasticSearchIndexDeleteTest.php

.php_cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ Currently most of the tests require the DB connection to exist.
9898
docker-compose exec api vendor/bin/phpunit
9999
```
100100

101+
### Linting
102+
103+
```sh
104+
docker compose exec api vendor/bin/pint --test -v
105+
```
106+
101107
#### Debugging
102108

103109
If you get a CORS error from an API when testing, it might be due to an exception internally, resulting in a 500 response with no CORS.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"require-dev": {
3737
"barryvdh/laravel-ide-helper": "2.13",
3838
"fakerphp/faker": "^1.17",
39+
"laravel/pint": "^1.22",
3940
"mockery/mockery": "^1.4",
4041
"phpunit/phpunit": "^10.5",
4142
"psalm/plugin-laravel": "^2.8",
@@ -68,8 +69,7 @@
6869
],
6970
"psalm": "vendor/bin/psalm",
7071
"phpunit": "vendor/bin/phpunit",
71-
"check-style": "php-cs-fixer fix --dry-run --diff",
72-
"fix-style": "php-cs-fixer fix"
72+
"pint": "vendor/bin/pint"
7373
},
7474
"config": {
7575
"platform": {

composer.lock

Lines changed: 71 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "laravel"
3+
}

0 commit comments

Comments
 (0)