From 53ce553bbf9f07ba71e93a23832e85bbe9dae19e Mon Sep 17 00:00:00 2001 From: Devin Haska <2636402+wonderfulfrog@users.noreply.github.com> Date: Wed, 12 Mar 2025 14:32:23 -0700 Subject: [PATCH] feat: add pint and php-cs-fixer global configs --- .config/php-cs-fixer/php-cs-fixer.php | 25 +++++++++++++++++++++++++ .config/pint/pint.json | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .config/php-cs-fixer/php-cs-fixer.php create mode 100644 .config/pint/pint.json diff --git a/.config/php-cs-fixer/php-cs-fixer.php b/.config/php-cs-fixer/php-cs-fixer.php new file mode 100644 index 0000000..a42cebb --- /dev/null +++ b/.config/php-cs-fixer/php-cs-fixer.php @@ -0,0 +1,25 @@ + true, + 'braces_position' => [ + 'anonymous_classes_opening_brace' => 'same_line', + 'anonymous_functions_opening_brace' => 'same_line', + 'classes_opening_brace' => 'same_line', + 'control_structures_opening_brace' => 'same_line', + 'functions_opening_brace' => 'same_line', + ], + 'no_leading_import_slash' => false, + 'not_operator_with_space' => false, + 'not_operator_with_successor_space' => false, +]; + +$finder = (new PhpCsFixer\Finder()) + ->in(__DIR__); + +return (new PhpCsFixer\Config()) + ->setRules($rules) + ->setFinder($finder) + ->setIndent(' ') + ->setLineEnding("\n") + ->setRiskyAllowed(true); diff --git a/.config/pint/pint.json b/.config/pint/pint.json new file mode 100644 index 0000000..4c46d36 --- /dev/null +++ b/.config/pint/pint.json @@ -0,0 +1,15 @@ +{ + "preset": "laravel", + "rules": { + "braces_position": { + "anonymous_classes_opening_brace": "same_line", + "anonymous_functions_opening_brace": "same_line", + "classes_opening_brace": "same_line", + "control_structures_opening_brace": "same_line", + "functions_opening_brace": "same_line" + }, + "no_leading_import_slash": false, + "not_operator_with_space": false, + "not_operator_with_successor_space": false + } +}