Skip to content

Add code linting using Laravel Pint #940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/composer.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
run: docker compose exec -e APP_ENV=testing -T api vendor/bin/phpunit
- name: Psalm
run: docker compose exec -T api vendor/bin/psalm
- name: Linting
run: docker compose exec api vendor/bin/pint --test -v

- name: Run elasticsearch index deletion integration test
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
Expand Down
19 changes: 0 additions & 19 deletions .php_cs

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Currently most of the tests require the DB connection to exist.
docker compose exec api vendor/bin/phpunit
```

### Linting

```sh
docker compose exec api vendor/bin/pint --test -v
```

#### Debugging

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.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"require-dev": {
"barryvdh/laravel-ide-helper": "2.13",
"fakerphp/faker": "^1.17",
"laravel/pint": "^1.22",
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^10.5",
"psalm/plugin-laravel": "^2.8",
Expand Down Expand Up @@ -68,8 +69,7 @@
],
"psalm": "vendor/bin/psalm",
"phpunit": "vendor/bin/phpunit",
"check-style": "php-cs-fixer fix --dry-run --diff",
"fix-style": "php-cs-fixer fix"
"pint": "vendor/bin/pint"
},
"config": {
"platform": {
Expand Down
76 changes: 71 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "laravel"
}
Loading