From d36d1d429cf29a03e27d332e1ee84b0c349eacfb Mon Sep 17 00:00:00 2001 From: William Renfrew Date: Fri, 22 Aug 2025 19:50:45 +0100 Subject: [PATCH 1/6] Update main pint wrapper We depend on laravel/pint so can safely assume its location --- pint | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pint b/pint index ad4ae1f..8710aa3 100755 --- a/pint +++ b/pint @@ -11,13 +11,8 @@ CONFIG_FILE="$SCRIPT_DIR/pint.json" # Try to find pint executable in different locations PINT_EXECUTABLE="" -if [ -f "./vendor/bin/pint" ]; then - PINT_EXECUTABLE="./vendor/bin/pint" -elif [ -f "../../../bin/pint" ]; then - # When installed via Composer in vendor/synergitech/laravel-coding-standards - PINT_EXECUTABLE="../../../bin/pint" -elif command -v pint >/dev/null 2>&1; then - PINT_EXECUTABLE="pint" +if [ -f "./vendor/laravel/pint/builds/pint" ]; then + PINT_EXECUTABLE="./vendor/laravel/pint/builds/pint" else echo "Error: Laravel Pint not found. Please install it with 'composer require laravel/pint --dev'" exit 1 @@ -31,4 +26,4 @@ fi # Run pint with the config file echo "Running Laravel Pint with config: $CONFIG_FILE" -$PINT_EXECUTABLE --config="$CONFIG_FILE" \ No newline at end of file +$PINT_EXECUTABLE --config="$CONFIG_FILE" From f2ae8678f75cabd1232ca6f61235a970f413d005 Mon Sep 17 00:00:00 2001 From: William Renfrew Date: Fri, 22 Aug 2025 19:51:31 +0100 Subject: [PATCH 2/6] Update pint-test --- pint-test | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pint-test b/pint-test index 73b9cd9..32e2819 100755 --- a/pint-test +++ b/pint-test @@ -1,7 +1,7 @@ #!/bin/bash -# Laravel Pint - Test coding standards -# This script runs Laravel Pint in test mode to check for coding standard issues without making changes +# Laravel Pint - Apply coding standards +# This script runs Laravel Pint to automatically fix coding standard issues # Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -11,13 +11,8 @@ CONFIG_FILE="$SCRIPT_DIR/pint.json" # Try to find pint executable in different locations PINT_EXECUTABLE="" -if [ -f "./vendor/bin/pint" ]; then - PINT_EXECUTABLE="./vendor/bin/pint" -elif [ -f "../../../bin/pint" ]; then - # When installed via Composer in vendor/synergitech/laravel-coding-standards - PINT_EXECUTABLE="../../../bin/pint" -elif command -v pint >/dev/null 2>&1; then - PINT_EXECUTABLE="pint" +if [ -f "./vendor/laravel/pint/builds/pint" ]; then + PINT_EXECUTABLE="./vendor/laravel/pint/builds/pint" else echo "Error: Laravel Pint not found. Please install it with 'composer require laravel/pint --dev'" exit 1 @@ -29,6 +24,6 @@ if [ ! -f "$CONFIG_FILE" ]; then exit 1 fi -# Run pint in test mode with the config file -echo "Testing coding standards with Laravel Pint using config: $CONFIG_FILE" -$PINT_EXECUTABLE --test --config="$CONFIG_FILE" \ No newline at end of file +# Run pint with the config file +echo "Running Laravel Pint with config: $CONFIG_FILE" +$PINT_EXECUTABLE --test --config="$CONFIG_FILE" From 6cfdaba35b99cb5a4503493fcd9c11e0705c3bb1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 Aug 2025 14:11:24 +0100 Subject: [PATCH 3/6] Allow pint wrapper scripts to accept and pass through command-line arguments (#5) * Initial plan * Allow pint wrappers to accept and pass through command-line arguments Co-authored-by: williamrenfrew <12625062+williamrenfrew@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: williamrenfrew <12625062+williamrenfrew@users.noreply.github.com> --- README.md | 13 ++++++++ composer.lock | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ pint | 4 +-- pint-test | 4 +-- 4 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 composer.lock diff --git a/README.md b/README.md index adcfe27..5d50d53 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ Or if installed as submodule/manually: ./pint ``` +You can pass additional arguments to customize the behavior: +```bash +./vendor/synergitech/laravel-coding-standards/pint --verbose +./vendor/synergitech/laravel-coding-standards/pint --dry-run +./vendor/synergitech/laravel-coding-standards/pint app/Models +``` + #### Test Code Standards To check for coding standard issues without making changes: ```bash @@ -64,6 +71,12 @@ Or if installed as submodule/manually: ./pint-test ``` +You can pass additional arguments to customize the testing: +```bash +./vendor/synergitech/laravel-coding-standards/pint-test --verbose +./vendor/synergitech/laravel-coding-standards/pint-test app/Controllers +``` + ### Adding Scripts to Your Composer.json For easier access, you can add these scripts to your project's `composer.json`: diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..923c40b --- /dev/null +++ b/composer.lock @@ -0,0 +1,90 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "77127698dab1ac0be0c03d82dcded204", + "packages": [ + { + "name": "laravel/pint", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "0345f3b05f136801af8c339f9d16ef29e6b4df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/0345f3b05f136801af8c339f9d16ef29e6b4df8a", + "reference": "0345f3b05f136801af8c339f9d16ef29e6b4df8a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.82.2", + "illuminate/view": "^11.45.1", + "larastan/larastan": "^3.5.0", + "laravel-zero/framework": "^11.45.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^2.3.1", + "pestphp/pest": "^2.36.0" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "files": [ + "overrides/Runner/Parallel/ProcessFactory.php" + ], + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2025-07-10T18:09:32+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^8.1" + }, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/pint b/pint index 8710aa3..8968ddd 100755 --- a/pint +++ b/pint @@ -24,6 +24,6 @@ if [ ! -f "$CONFIG_FILE" ]; then exit 1 fi -# Run pint with the config file +# Run pint with the config file and pass through all arguments echo "Running Laravel Pint with config: $CONFIG_FILE" -$PINT_EXECUTABLE --config="$CONFIG_FILE" +$PINT_EXECUTABLE --config="$CONFIG_FILE" "$@" diff --git a/pint-test b/pint-test index 32e2819..2a21d78 100755 --- a/pint-test +++ b/pint-test @@ -24,6 +24,6 @@ if [ ! -f "$CONFIG_FILE" ]; then exit 1 fi -# Run pint with the config file +# Run pint with the config file and pass through all arguments echo "Running Laravel Pint with config: $CONFIG_FILE" -$PINT_EXECUTABLE --test --config="$CONFIG_FILE" +$PINT_EXECUTABLE --test --config="$CONFIG_FILE" "$@" From 761664b49bf881c42a6b9d838f1e1e65be51771c Mon Sep 17 00:00:00 2001 From: William Renfrew Date: Tue, 26 Aug 2025 11:28:54 +0100 Subject: [PATCH 4/6] Updated --- pint-test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pint-test b/pint-test index 2a21d78..cd0302b 100755 --- a/pint-test +++ b/pint-test @@ -1,7 +1,7 @@ #!/bin/bash -# Laravel Pint - Apply coding standards -# This script runs Laravel Pint to automatically fix coding standard issues +# Laravel Pint - Test coding standards +# This script runs Laravel Pint to test the code matches standards # Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" From 1e652ab9b2915f44eabc858ae3cabbf1c42e657f Mon Sep 17 00:00:00 2001 From: William Renfrew Date: Tue, 26 Aug 2025 11:29:40 +0100 Subject: [PATCH 5/6] cleanup --- composer.lock | 90 --------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 923c40b..0000000 --- a/composer.lock +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "77127698dab1ac0be0c03d82dcded204", - "packages": [ - { - "name": "laravel/pint", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/pint.git", - "reference": "0345f3b05f136801af8c339f9d16ef29e6b4df8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/0345f3b05f136801af8c339f9d16ef29e6b4df8a", - "reference": "0345f3b05f136801af8c339f9d16ef29e6b4df8a", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "ext-tokenizer": "*", - "ext-xml": "*", - "php": "^8.2.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.82.2", - "illuminate/view": "^11.45.1", - "larastan/larastan": "^3.5.0", - "laravel-zero/framework": "^11.45.0", - "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^2.3.1", - "pestphp/pest": "^2.36.0" - }, - "bin": [ - "builds/pint" - ], - "type": "project", - "autoload": { - "files": [ - "overrides/Runner/Parallel/ProcessFactory.php" - ], - "psr-4": { - "App\\": "app/", - "Database\\Seeders\\": "database/seeders/", - "Database\\Factories\\": "database/factories/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "An opinionated code formatter for PHP.", - "homepage": "https://laravel.com", - "keywords": [ - "format", - "formatter", - "lint", - "linter", - "php" - ], - "support": { - "issues": "https://github.com/laravel/pint/issues", - "source": "https://github.com/laravel/pint" - }, - "time": "2025-07-10T18:09:32+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": {}, - "prefer-stable": true, - "prefer-lowest": false, - "platform": { - "php": "^8.1" - }, - "platform-dev": {}, - "plugin-api-version": "2.6.0" -} From df988f460b25e92cce9727ce07218859214a2166 Mon Sep 17 00:00:00 2001 From: William Renfrew Date: Wed, 27 Aug 2025 18:20:42 +0100 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: edenchazard <38665888+edenchazard@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d50d53..6f0bc5f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Or if installed as submodule/manually: ./pint ``` -You can pass additional arguments to customize the behavior: +You can pass additional arguments to customise the behaviour: ```bash ./vendor/synergitech/laravel-coding-standards/pint --verbose ./vendor/synergitech/laravel-coding-standards/pint --dry-run @@ -71,7 +71,7 @@ Or if installed as submodule/manually: ./pint-test ``` -You can pass additional arguments to customize the testing: +You can pass additional arguments to customise the testing: ```bash ./vendor/synergitech/laravel-coding-standards/pint-test --verbose ./vendor/synergitech/laravel-coding-standards/pint-test app/Controllers