Skip to content

Commit

Permalink
set-up x-ray to avoid dumps in code
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Mar 5, 2022
1 parent 43f9e78 commit 2b30da9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/testbench.yaml export-ignore
/x-ray.yml export-ignore
26 changes: 26 additions & 0 deletions .github/workflows/x-ray.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: x-ray

on:
push:
paths:
- '**.php'
- 'x-ray.yml'

jobs:
x-ray:
name: x-ray
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: ./vendor/bin/x-ray .
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}
},
"scripts": {
"x-ray": "vendor/bin/x-ray .",
"lint": "vendor/bin/php-cs-fixer fix -v",
"test:lint": "vendor/bin/php-cs-fixer fix -v --dry-run",
"test:types": "vendor/bin/phpstan analyse --ansi",
Expand Down
16 changes: 16 additions & 0 deletions x-ray.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
functions:
include:
- 'ray'
- 'rd'
- 'dump'
- 'dd'
- 'var_dump'
- 'print_r'

paths:
ignore:
- '.github/*'
- 'build/*'
- 'docs/*'
- 'vendor/*'
- 'src/Support/Testing/Fakes/TelegraphFake.php'

0 comments on commit 2b30da9

Please sign in to comment.