|
11 | 11 | use NunoMaduro\PhpInsights\Domain\Metrics\Code\Code; |
12 | 12 | use NunoMaduro\PhpInsights\Domain\Metrics\Style\Style; |
13 | 13 | use PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff; |
| 14 | +use PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff; |
14 | 15 | use PhpCsFixer\Fixer\Alias\ArrayPushFixer; |
15 | 16 | use PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer; |
16 | 17 | use PhpCsFixer\Fixer\Alias\MbStrFunctionsFixer; |
| 18 | +use PhpCsFixer\Fixer\Basic\BracesFixer; |
17 | 19 | use PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer; |
| 20 | +use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer; |
18 | 21 | use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer; |
19 | 22 | use PhpCsFixer\Fixer\ClassNotation\OrderedInterfacesFixer; |
20 | 23 | use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer; |
|
30 | 33 | use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer; |
31 | 34 | use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; |
32 | 35 | use PhpCsFixer\Fixer\Strict\StrictComparisonFixer; |
| 36 | +use SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff; |
| 37 | +use SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff; |
33 | 38 | use SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff; |
34 | 39 | use SlevomatCodingStandard\Sniffs\ControlStructures\DisallowEmptySniff; |
| 40 | +use SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff; |
35 | 41 | use SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff; |
36 | 42 | use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff; |
37 | 43 | use SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff; |
|
92 | 98 | 'src/Console/Commands/', |
93 | 99 | 'src/HooksPipeline.php', |
94 | 100 | 'src/Git/Log.php', |
| 101 | + 'src/Traits/ProcessHelper.php', |
95 | 102 | 'tests/Files/*WithFixableIssues.php', |
96 | 103 | 'tests/TestCase.php', |
97 | 104 | ], |
|
127 | 134 |
|
128 | 135 | 'remove' => [ |
129 | 136 | AlphabeticallySortedUsesSniff::class, |
| 137 | + BracesFixer::class, // Let Pint handle brace formatting |
| 138 | + ClassDefinitionFixer::class, // Let Pint handle class definitions |
130 | 139 | DeclareStrictTypesSniff::class, // We use DeclareStrictTypesFixer from PHP-CS-Fixer instead |
131 | 140 | DisallowEmptySniff::class, // Allow using empty() function |
132 | 141 | DisallowMixedTypeHintSniff::class, |
| 142 | + DisallowYodaComparisonSniff::class, // Allow normal comparisons |
| 143 | + DocCommentSpacingSniff::class, // Let Pint handle PHPDoc spacing |
133 | 144 | ForbiddenDefineFunctions::class, |
134 | 145 | ForbiddenNormalClasses::class, |
135 | 146 | ForbiddenTraits::class, |
| 147 | + NewWithParenthesesFixer::class, // Disabled as per pint.json |
| 148 | + NotOperatorWithSuccessorSpaceFixer::class, // Disabled as per pint.json |
136 | 149 | ParameterTypeHintSniff::class, |
137 | 150 | PropertyTypeHintSniff::class, |
138 | 151 | ReturnTypeHintSniff::class, |
139 | | - UselessFunctionDocCommentSniff::class, |
140 | | - NewWithParenthesesFixer::class, // Disabled as per pint.json |
141 | | - NotOperatorWithSuccessorSpaceFixer::class, // Disabled as per pint.json |
142 | | - DisallowYodaComparisonSniff::class, // Allow normal comparisons |
| 152 | + ScopeClosingBraceSniff::class, // Let Pint handle closing brace style |
143 | 153 | SpaceAfterNotSniff::class, // Don't require space after NOT operator - Pint handles this |
| 154 | + SuperfluousExceptionNamingSniff::class, // Allow Exception suffix for exception classes |
| 155 | + UselessFunctionDocCommentSniff::class, |
144 | 156 | ], |
145 | 157 |
|
146 | 158 | 'config' => [ |
147 | 159 | ForbiddenPrivateMethods::class => [ |
148 | 160 | 'title' => 'The usage of private methods is not idiomatic in Laravel.', |
149 | 161 | ], |
| 162 | + FunctionLengthSniff::class => [ |
| 163 | + 'maxLinesLength' => 25, // Allow functions up to 25 lines |
| 164 | + ], |
150 | 165 | OrderedClassElementsFixer::class => [ |
151 | 166 | 'order' => [ |
152 | 167 | 'use_trait', |
|
0 commit comments