Skip to content

Commit 69f842c

Browse files
Update main pint wrapper (#4)
1 parent 0108f9c commit 69f842c

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ Or if installed as submodule/manually:
5151
./pint
5252
```
5353

54+
You can pass additional arguments to customise the behaviour:
55+
```bash
56+
./vendor/synergitech/laravel-coding-standards/pint --verbose
57+
./vendor/synergitech/laravel-coding-standards/pint --dry-run
58+
./vendor/synergitech/laravel-coding-standards/pint app/Models
59+
```
60+
5461
#### Test Code Standards
5562
To check for coding standard issues without making changes:
5663
```bash
@@ -64,6 +71,12 @@ Or if installed as submodule/manually:
6471
./pint-test
6572
```
6673

74+
You can pass additional arguments to customise the testing:
75+
```bash
76+
./vendor/synergitech/laravel-coding-standards/pint-test --verbose
77+
./vendor/synergitech/laravel-coding-standards/pint-test app/Controllers
78+
```
79+
6780
### Adding Scripts to Your Composer.json
6881

6982
For easier access, you can add these scripts to your project's `composer.json`:

pint

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@ CONFIG_FILE="$SCRIPT_DIR/pint.json"
1111

1212
# Try to find pint executable in different locations
1313
PINT_EXECUTABLE=""
14-
if [ -f "./vendor/bin/pint" ]; then
15-
PINT_EXECUTABLE="./vendor/bin/pint"
16-
elif [ -f "../../../bin/pint" ]; then
17-
# When installed via Composer in vendor/synergitech/laravel-coding-standards
18-
PINT_EXECUTABLE="../../../bin/pint"
19-
elif command -v pint >/dev/null 2>&1; then
20-
PINT_EXECUTABLE="pint"
14+
if [ -f "./vendor/laravel/pint/builds/pint" ]; then
15+
PINT_EXECUTABLE="./vendor/laravel/pint/builds/pint"
2116
else
2217
echo "Error: Laravel Pint not found. Please install it with 'composer require laravel/pint --dev'"
2318
exit 1
@@ -29,6 +24,6 @@ if [ ! -f "$CONFIG_FILE" ]; then
2924
exit 1
3025
fi
3126

32-
# Run pint with the config file
27+
# Run pint with the config file and pass through all arguments
3328
echo "Running Laravel Pint with config: $CONFIG_FILE"
34-
$PINT_EXECUTABLE --config="$CONFIG_FILE"
29+
$PINT_EXECUTABLE --config="$CONFIG_FILE" "$@"

pint-test

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Laravel Pint - Test coding standards
4-
# This script runs Laravel Pint in test mode to check for coding standard issues without making changes
4+
# This script runs Laravel Pint to test the code matches standards
55

66
# Get the directory where this script is located
77
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -11,13 +11,8 @@ CONFIG_FILE="$SCRIPT_DIR/pint.json"
1111

1212
# Try to find pint executable in different locations
1313
PINT_EXECUTABLE=""
14-
if [ -f "./vendor/bin/pint" ]; then
15-
PINT_EXECUTABLE="./vendor/bin/pint"
16-
elif [ -f "../../../bin/pint" ]; then
17-
# When installed via Composer in vendor/synergitech/laravel-coding-standards
18-
PINT_EXECUTABLE="../../../bin/pint"
19-
elif command -v pint >/dev/null 2>&1; then
20-
PINT_EXECUTABLE="pint"
14+
if [ -f "./vendor/laravel/pint/builds/pint" ]; then
15+
PINT_EXECUTABLE="./vendor/laravel/pint/builds/pint"
2116
else
2217
echo "Error: Laravel Pint not found. Please install it with 'composer require laravel/pint --dev'"
2318
exit 1
@@ -29,6 +24,6 @@ if [ ! -f "$CONFIG_FILE" ]; then
2924
exit 1
3025
fi
3126

32-
# Run pint in test mode with the config file
33-
echo "Testing coding standards with Laravel Pint using config: $CONFIG_FILE"
34-
$PINT_EXECUTABLE --test --config="$CONFIG_FILE"
27+
# Run pint with the config file and pass through all arguments
28+
echo "Running Laravel Pint with config: $CONFIG_FILE"
29+
$PINT_EXECUTABLE --test --config="$CONFIG_FILE" "$@"

0 commit comments

Comments
 (0)