Skip to content

Commit ba57f62

Browse files
committed
ci(config): Update config files
1 parent 5b6b415 commit ba57f62

9 files changed

Lines changed: 74 additions & 105 deletions

File tree

.github/git-commit-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- The details about what was done in the body of the message.
2020
- Any useful details concerning the change in the body of the message.
2121
- Use a hyphen (-) for the bullet points in the body of the message.
22-
- Use {locale} language to answer..
22+
- Use {locale} language to answer.
2323
- No code blocks.
2424

2525
## Write 1 commit messages that accurately summarizes the changes made in the given `git diff` output, following the best practices listed above and the conventional commit format

README-zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ php artisan soar:score --ansi < tests/Fixtures/queries.sql
545545

546546
```shell
547547
composer checks:required
548+
composer php-cs-fixer:fix
548549
composer test
549550
composer testbench soar:run
550551
composer testbench soar:score

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ php artisan soar:score --ansi < tests/Fixtures/queries.sql
545545

546546
```shell
547547
composer checks:required
548+
composer php-cs-fixer:fix
548549
composer test
549550
composer testbench soar:run
550551
composer testbench soar:score

composer-bump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $statusCode = (new SingleCommandApplication)
5656

5757
exit($statusCode);
5858

59-
class ComposerBump
59+
final class ComposerBump
6060
{
6161
private readonly string $composerJsonPath;
6262
private readonly string $composer;

composer.json

Lines changed: 17 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"ergebnis/license": "^2.7",
6969
"ergebnis/php-cs-fixer-config": "^6.57",
7070
"ergebnis/rector-rules": "^1.7",
71-
"guanguans/monorepo-builder-worker": "^2.1",
71+
"guanguans/php-cs-fixer-custom-fixers": "^1.0",
7272
"itsgoingd/clockwork": "^5.3",
7373
"laradumps/laradumps": "^4.6",
7474
"laravel/facade-documenter": "dev-main",
@@ -108,8 +108,7 @@
108108
"yamadashy/phpstan-friendly-formatter": "^1.3"
109109
},
110110
"conflict": {
111-
"pestphp/pest": "^4.0",
112-
"symplify/monorepo-builder": "^12.0"
111+
"pestphp/pest": "^4.0"
113112
},
114113
"suggest": {
115114
"barryvdh/laravel-debugbar": "Output SQL scores to Laravel DebugBar.",
@@ -199,22 +198,11 @@
199198
"@testbench:clear",
200199
"@testbench:prepare"
201200
],
202-
"actionlint": [
203-
"if ! command -v actionlint >/dev/null 2>&1; then echo 'actionlint not found, installing...'; brew install actionlint; fi",
204-
"actionlint -ignore=SC2035 -ignore=SC2086 -color -oneline -verbose"
205-
],
201+
"actionlint": "actionlint -ignore=SC2035 -ignore=SC2086 -color -oneline -verbose",
206202
"blade-formatter": "blade-formatter resources/views/*.blade.php resources/views/**/*.blade.php --ignore-path= --php-version=8.1 --progress",
207203
"blade-formatter:check-formatted": "@blade-formatter --check-formatted",
208204
"blade-formatter:write": "@blade-formatter --write",
209205
"cghooks": "@php vendor/bin/cghooks --ansi -vv",
210-
"cghooks:remove": [
211-
"@php -r \"file_exists('.git/hooks/post-merge') and rename('.git/hooks/post-merge', '.git/hooks/post-merge.sample');\"",
212-
"@php -r \"file_exists('.git/hooks/pre-commit') and rename('.git/hooks/pre-commit', '.git/hooks/pre-commit.sample');\""
213-
],
214-
"cghooks:try": [
215-
"@putenv:php",
216-
"[ ! -f \"vendor/bin/cghooks\" ] && exit 0 || $PHP81 vendor/bin/cghooks --ansi -vv"
217-
],
218206
"cghooks:upsert": [
219207
"@cghooks add --ignore-lock",
220208
"@cghooks update"
@@ -230,6 +218,7 @@
230218
"@composer:normalize-dry-run",
231219
"@detect-collisions",
232220
"@facade:lint",
221+
"@jack:breakpoint",
233222
"@jack:open-versions-dry-run",
234223
"@jack:raise-to-installed-dry-run",
235224
"@phpmnd",
@@ -252,7 +241,7 @@
252241
"checks:required": [
253242
"@putenv:xdebug-off",
254243
"@php-cs-fixer:fix-dry-run",
255-
"@pest:bail"
244+
"@pest"
256245
],
257246
"class-leak": "@php vendor/bin/class-leak --ansi -vv",
258247
"class-leak:check": "@class-leak check config/ src/ --skip-type=Guanguans\\LaravelSoar\\Contracts\\OutputContract --skip-suffix=InvalidArgumentException --skip-path=Support/Rectors/",
@@ -296,7 +285,7 @@
296285
"$PHP82 vendor/bin/grumphp run --ansi -vv"
297286
],
298287
"jack": "@php vendor/bin/jack --ansi -vv",
299-
"jack:breakpoint": "@jack breakpoint --limit=5",
288+
"jack:breakpoint": "@jack breakpoint --limit=7",
300289
"jack:breakpoint-dev": "@jack:breakpoint --dev",
301290
"jack:open-versions": "@jack open-versions --limit=99",
302291
"jack:open-versions-dev": "@jack:open-versions --dev",
@@ -328,7 +317,10 @@
328317
"mago:lint-dry-run": "@mago:lint --dry-run",
329318
"mago:lint-list-rules": "@mago lint --list-rules",
330319
"mago:lint-semantics-only": "@mago lint --semantics-only",
331-
"monorepo-builder": "@php vendor/bin/monorepo-builder --ansi -vv",
320+
"monorepo-builder": [
321+
"@putenv:php",
322+
"$PHP82 vendor/bin/monorepo-builder --ansi -vv"
323+
],
332324
"monorepo-builder:release": "@monorepo-builder release",
333325
"monorepo-builder:release-1.0.0-BETA1": "@monorepo-builder:release 1.0.0-BETA1",
334326
"monorepo-builder:release-1.0.0-BETA1-dry-run": "@monorepo-builder:release-1.0.0-BETA1 --dry-run",
@@ -350,10 +342,7 @@
350342
"@php vendor/bin/pest --colors=always --min=80 --coverage --profile",
351343
"@putenv:xdebug-off"
352344
],
353-
"pest:bail": "@pest --bail",
354-
"pest:compact": "@pest --compact",
355345
"pest:coverage": "@pest --coverage-html=.build/phpunit/ --coverage-clover=.build/phpunit/clover.xml",
356-
"pest:disable-coverage-ignore": "@pest --disable-coverage-ignore",
357346
"pest:highest": [
358347
"@putenv:php",
359348
"@putenv:xdebug-on",
@@ -367,8 +356,11 @@
367356
"pest:type-coverage": "@pest --type-coverage",
368357
"pest:update-snapshots": "@pest --update-snapshots",
369358
"php-cs-fixer": "@php vendor/bin/php-cs-fixer --ansi -vv",
370-
"php-cs-fixer:check": "@php-cs-fixer check --show-progress=dots --diff",
371-
"php-cs-fixer:describe": "@php-cs-fixer describe",
359+
"php-cs-fixer:custom": "@php-cs-fixer --config=.php-cs-fixer-custom.php",
360+
"php-cs-fixer:custom-check": "@php-cs-fixer:custom check --show-progress=dots --diff",
361+
"php-cs-fixer:custom-fix": "@php-cs-fixer:custom fix --show-progress=dots --diff",
362+
"php-cs-fixer:custom-fix-dry-run": "@php-cs-fixer:custom-fix --dry-run",
363+
"php-cs-fixer:custom-list-files": "@php-cs-fixer:custom list-files",
372364
"php-cs-fixer:fix": "@php-cs-fixer fix --show-progress=dots --diff",
373365
"php-cs-fixer:fix-dry-run": "@php-cs-fixer:fix --dry-run",
374366
"php-cs-fixer:list-files": "@php-cs-fixer list-files",
@@ -379,14 +371,9 @@
379371
"for DIR in src/ tests/; do find $DIR -type f -name '*.php' -type f ! -name 'xxx.php' -exec $PHP81 -l {} \\; 2>&1 | (! grep -v '^No syntax errors detected'); done"
380372
],
381373
"phpbench": "@php vendor/bin/phpbench run --report=aggregate --ansi -vv",
382-
"phpcs": "@php vendor/bin/phpcs config/ src/ --extensions=php --ignore=*/vendor/* --parallel=8 --cache --colors -n -p -s -v",
383-
"phpcs:compatibility": "@phpcs --standard=PHPCompatibility --exclude=PHPCompatibility.FunctionDeclarations.NewClosure --runtime-set testVersion 8.5-",
384-
"phpcs:help": "@phpcs --help",
385-
"phpcs:i": "@phpcs -i",
386374
"phpmnd": "@php vendor/bin/phpmnd src/ --exclude-path=Support/helpers.phpp --ignore-numbers=2,-1 --hint --progress --ansi -vv",
387375
"phpstan": "@php vendor/bin/phpstan --ansi -vv",
388376
"phpstan:analyse": "@phpstan analyse",
389-
"phpstan:analyse-fix": "@phpstan:analyse --fix",
390377
"phpstan:analyse-generate-baseline": "@phpstan:analyse --generate-baseline --allow-empty-baseline",
391378
"phpstan:analyse-split-baseline": [
392379
"@phpstan:analyse --generate-baseline=baselines/loader.neon --allow-empty-baseline",
@@ -399,10 +386,6 @@
399386
"@putenv:xdebug-off",
400387
"@php vendor/bin/pint --ansi -vv"
401388
],
402-
"pint:bail": "@pint --bail",
403-
"pint:dirty": "@pint --dirty",
404-
"pint:dirty-bail": "@pint:dirty --bail",
405-
"pint:dirty-test": "@pint:dirty --test",
406389
"pint:test": "@pint --test",
407390
"putenv:composer-memory-unlimited": "@putenv COMPOSER_MEMORY_LIMIT=-1",
408391
"putenv:php": [
@@ -419,7 +402,6 @@
419402
"@putenv XDEBUG_MODE=coverage,debug",
420403
"@putenv XDEBUG_SESSION=1"
421404
],
422-
"readme-lint": "@php readme-lint --ansi -vv",
423405
"rector": "@php vendor/bin/rector",
424406
"rector:custom-rule": "@rector custom-rule",
425407
"rector:list-rules": "@rector list-rules",
@@ -429,9 +411,6 @@
429411
"rector:process-dry-run": "@rector:process --dry-run",
430412
"rector:process-only": "@rector:process-clear-cache --only=Guanguans\\LaravelSoar\\Support\\Rectors\\AddHasOptionsDocCommentRector",
431413
"rector:process-only-dry-run": "@rector:process-only --dry-run",
432-
"rector:process-soar-options": "@rector:process-clear-cache --config=rector-options.php",
433-
"rector:process-soar-options-dry-run": "@rector:process-soar-options --dry-run",
434-
"rector:setup-ci": "@rector setup-ci",
435414
"rule-doc-generator": [
436415
"@putenv:php",
437416
"$PHP82 rule-doc-generator --ansi -vv"
@@ -478,15 +457,6 @@
478457
"todo-lint": "! git --no-pager grep --extended-regexp --ignore-case 'todo|fixme' -- '*.php' ':!*.blade.php' ':(exclude)resources/'",
479458
"touch:database-sqlite": "@php -r \"file_exists('vendor/orchestra/testbench-core/laravel/database/database.sqlite') || touch('vendor/orchestra/testbench-core/laravel/database/database.sqlite');\"",
480459
"trufflehog": "trufflehog git https://github.com/guanguans/laravel-soar --only-verified",
481-
"user:composer": [
482-
"@putenv:composer-memory-unlimited",
483-
"@putenv:xdebug-off",
484-
"@composer --ansi -vv"
485-
],
486-
"user:php": [
487-
"@putenv:xdebug-off",
488-
"@php -d xdebug.mode=off"
489-
],
490460
"var-dump-server:cli": "@php vendor/bin/var-dump-server --ansi -vv",
491461
"var-dump-server:html": [
492462
"@composer-config:disable-process-timeout",
@@ -496,22 +466,15 @@
496466
"@php vendor/bin/var-dump-server --ansi -v --format=html > .build/dump.html"
497467
],
498468
"vendor-patches": "@php vendor/bin/vendor-patches generate --ansi -vv",
499-
"vhs": [
500-
"@cghooks:remove",
501-
"vhs < laravel-soar.tape",
502-
"@cghooks:upsert"
503-
],
469+
"vhs": "vhs < laravel-soar.tape",
504470
"yaml-lint": "@php vendor/bin/yaml-lint .github/ *.yaml --ansi -vv",
505471
"zhlint": [
506472
"if ! command -v zhlint >/dev/null 2>&1; then echo 'zhlint not found, installing...'; npm install -g zhlint; fi",
507473
"@zhlint:prototype"
508474
],
509475
"zhlint:fix": "@zhlint:prototype --fix",
510476
"zhlint:prototype": "zhlint {,docs/,docs/**/}*-zh_CN.md",
511-
"zizmor": [
512-
"if ! command -v zizmor >/dev/null 2>&1; then echo 'zizmor not found, installing...'; brew install zizmor; fi",
513-
"zizmor .github/ --verbose"
514-
]
477+
"zizmor": "zizmor .github/ --verbose"
515478
},
516479
"scripts-aliases": {
517480
"pest": [

rector.php

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
->withRules([
127127
ArraySpreadInsteadOfArrayMergeRector::class,
128128
JsonThrowOnErrorRector::class,
129-
SimplifyListIndexRector::class,
129+
// SimplifyListIndexRector::class,
130130
SortAssociativeArrayByKeyRector::class,
131131
StaticArrowFunctionRector::class,
132132
StaticClosureRector::class,
@@ -136,22 +136,22 @@
136136
// ->dd()
137137
->all(),
138138
])
139-
->withConfiguredRule(AddNoinspectionsDocCommentToDeclareRector::class, [
140-
'AnonymousFunctionStaticInspection',
141-
'NullPointerExceptionInspection',
142-
'PhpPossiblePolymorphicInvocationInspection',
143-
'PhpUndefinedClassInspection',
144-
'PhpUnhandledExceptionInspection',
145-
'PhpVoidFunctionResultUsedInspection',
146-
'SqlResolve',
147-
'StaticClosureCanBeUsedInspection',
148-
])
149-
->withConfiguredRule(NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class, [
150-
ThrowableContract::class,
151-
])
152-
->withConfiguredRule(RemoveNamespaceRector::class, [
153-
'Guanguans\LaravelSoarTests',
154-
])
139+
// ->withConfiguredRule(AddNoinspectionsDocCommentToDeclareRector::class, [
140+
// 'AnonymousFunctionStaticInspection',
141+
// 'NullPointerExceptionInspection',
142+
// 'PhpPossiblePolymorphicInvocationInspection',
143+
// 'PhpUndefinedClassInspection',
144+
// 'PhpUnhandledExceptionInspection',
145+
// 'PhpVoidFunctionResultUsedInspection',
146+
// 'SqlResolve',
147+
// 'StaticClosureCanBeUsedInspection',
148+
// ])
149+
// ->withConfiguredRule(NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class, [
150+
// ThrowableContract::class,
151+
// ])
152+
// ->withConfiguredRule(RemoveNamespaceRector::class, [
153+
// 'Guanguans\LaravelSoarTests',
154+
// ])
155155
->withConfiguredRule(RemoveAnnotationRector::class, [
156156
'codeCoverageIgnore',
157157
'inheritDoc',
@@ -258,34 +258,34 @@ static function (array $carry, string $func): array {
258258
__DIR__.'/tests/',
259259
__DIR__.'/workbench/',
260260
],
261-
AddNoinspectionsDocCommentToDeclareRector::class => [
262-
// __DIR__.'/config/',
263-
__DIR__.'/src/',
264-
// __DIR__.'/tests/',
265-
__DIR__.'/workbench/',
266-
...$rootFiles = array_filter(
267-
glob(__DIR__.'/{*,.*}.php', \GLOB_BRACE),
268-
static fn (string $filename): bool => !\in_array(
269-
$filename,
270-
[
271-
__DIR__.'/tests.php',
272-
__DIR__.'/tests.php',
273-
],
274-
true
275-
)
276-
),
277-
__DIR__.'/composer-bump',
278-
],
279-
NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class => [
280-
__DIR__.'/src/Support/Rectors/',
281-
],
282-
RemoveNamespaceRector::class => [
283-
// __DIR__.'/config/',
284-
__DIR__.'/src/',
285-
// __DIR__.'/tests/',
286-
__DIR__.'/workbench/',
287-
...$rootFiles,
288-
__DIR__.'/composer-bump',
289-
__DIR__.'/tests/TestCase.php',
290-
],
261+
// AddNoinspectionsDocCommentToDeclareRector::class => [
262+
// // __DIR__.'/config/',
263+
// __DIR__.'/src/',
264+
// // __DIR__.'/tests/',
265+
// __DIR__.'/workbench/',
266+
// ...$rootFiles = array_filter(
267+
// glob(__DIR__.'/{*,.*}.php', \GLOB_BRACE),
268+
// static fn (string $filename): bool => !\in_array(
269+
// $filename,
270+
// [
271+
// __DIR__.'/tests.php',
272+
// __DIR__.'/tests.php',
273+
// ],
274+
// true
275+
// )
276+
// ),
277+
// __DIR__.'/composer-bump',
278+
// ],
279+
// NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class => [
280+
// __DIR__.'/src/Support/Rectors/',
281+
// ],
282+
// RemoveNamespaceRector::class => [
283+
// // __DIR__.'/config/',
284+
// __DIR__.'/src/',
285+
// // __DIR__.'/tests/',
286+
// __DIR__.'/workbench/',
287+
// ...$rootFiles,
288+
// __DIR__.'/composer-bump',
289+
// __DIR__.'/tests/TestCase.php',
290+
// ],
291291
]);

src/Support/helpers.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
function classes(?callable $filter = null): Collection
4444
{
4545
static $classes;
46-
4746
$classes ??= collect(spl_autoload_functions())->flatMap(
4847
static fn (mixed $loader): array => \is_array($loader) && $loader[0] instanceof ClassLoader
4948
? $loader[0]->getClassMap()

tests/Pest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323

2424
use Faker\Factory;
25+
use Faker\Generator;
2526
use Guanguans\LaravelSoarTests\TestCase;
2627
use Illuminate\Support\Facades\Artisan;
2728
use Pest\Expectation;

vendor-bin/php82/composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
"require-dev": {
33
"php": ">=8.2",
44
"ergebnis/composer-normalize": "^2.48",
5+
"guanguans/monorepo-builder-worker": "^2.1",
56
"peckphp/peck": "^0.2",
6-
"phpro/grumphp-shim": "^2.17",
7+
"phpro/grumphp-shim": "^2.18",
78
"theofidry/composer-inheritance-plugin": "^1.2"
89
},
10+
"conflict": {
11+
"symplify/monorepo-builder": "^12.0"
12+
},
913
"config": {
1014
"allow-plugins": {
1115
"ergebnis/composer-normalize": true,

0 commit comments

Comments
 (0)