Skip to content

Commit 206abd9

Browse files
committed
ci(config): Update config files
Signed-off-by: guanguans <[email protected]>
1 parent f0d1706 commit 206abd9

File tree

8 files changed

+105
-87
lines changed

8 files changed

+105
-87
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end_of_line = crlf
2727
trim_trailing_whitespace = false
2828
max_line_length = 80
2929

30-
[*.{yml,yml.dist,yaml,yaml.dist,xml,xml.dist}]
30+
[*.{yml,yml.dist,yaml,yaml.dist,xml,xml.dist,toml}]
3131
indent_size = 2
3232

3333
[*.{html,css,scss,js,ts,vue,jsx,tsx}]

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
/CHANGELOG.md export-ignore
5252
/composer-bump export-ignore
5353
/composer-dependency-analyser.php export-ignore
54+
/ecs.php export-ignore
5455
/monorepo-builder.php export-ignore
5556
/peck.json export-ignore
5657
/phpbench.json.dist export-ignore
5758
/phpstan.neon.dist export-ignore
5859
/phpunit.xml.dist export-ignore
59-
/rector-*.php export-ignore
60-
/rector.php export-ignore
60+
/rector.dist.php export-ignore
6161
/rule-doc-generator export-ignore
6262
/testbench.yaml export-ignore
6363
/tests.* export-ignore

.typos.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ extend-exclude = [
1313
[default]
1414
extend-ignore-re = [
1515
# https://github.com/sirwart/ripsecrets/blob/main/src/lib.rs
16-
'\b[0-9A-Za-z+/_-]{36,}\b', # Anything base64 or base64url longer than 36 chars is probably encoded.
17-
"at_[0-9a-zA-Z-]+", # 忽略以 at_ 开头的令牌字符串
16+
# '\b[0-9A-Za-z+/_-]{36,}\b', # Anything base64 or base64url longer than 36 chars is probably encoded.
1817
"[0-9A-Z]{16}", # 忽略评分 ID
1918
]
2019
extend-ignore-identifiers-re = [

composer-dependency-analyser.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
1616

1717
return (new Configuration)
18-
->addPathsToScan(
19-
[
20-
// __DIR__.'/src/',
21-
],
22-
false
23-
)
18+
// ->addPathsToScan([__DIR__.'/config/'], false)
2419
->addPathsToExclude([
2520
__DIR__.'/src/Support/ComposerScripts.php',
2621
__DIR__.'/src/Support/Rectors/',

ecs.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
3+
/** @noinspection PhpDeprecationInspection */
4+
/** @noinspection PhpUnhandledExceptionInspection */
5+
declare(strict_types=1);
6+
7+
/**
8+
* Copyright (c) 2019-2026 guanguans<[email protected]>
9+
*
10+
* For the full copyright and license information, please view
11+
* the LICENSE file that was distributed with this source code.
12+
*
13+
* @see https://github.com/guanguans/soar-php
14+
*/
15+
16+
use PhpCsFixer\Fixer\Basic\BracesPositionFixer;
17+
use PhpCsFixer\Fixer\Basic\SingleLineEmptyBodyFixer;
18+
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
19+
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
20+
use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
21+
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
22+
use PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer;
23+
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
24+
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
25+
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
26+
use PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer;
27+
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
28+
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
29+
use PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer;
30+
use PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer;
31+
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
32+
use PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer;
33+
use PhpCsFixer\Fixer\Whitespace\BlankLineBetweenImportGroupsFixer;
34+
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer;
35+
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer;
36+
use Symplify\CodingStandard\Fixer\Spacing\StandaloneLinePromotedPropertyFixer;
37+
use Symplify\EasyCodingStandard\Config\ECSConfig;
38+
39+
return ECSConfig::configure()
40+
->withPaths([
41+
__DIR__.'/src/',
42+
__DIR__.'/tests/',
43+
__DIR__.'/.changelog',
44+
__DIR__.'/composer-bump',
45+
])
46+
->withRootFiles()
47+
->withSkip([
48+
'*/Fixtures/*',
49+
__DIR__.'/_ide_helper.php',
50+
__DIR__.'/tests.php',
51+
BracesPositionFixer::class,
52+
SingleLineEmptyBodyFixer::class,
53+
ClassAttributesSeparationFixer::class,
54+
ClassDefinitionFixer::class,
55+
TrailingCommaInMultilineFixer::class,
56+
YodaStyleFixer::class,
57+
FunctionDeclarationFixer::class,
58+
ConcatSpaceFixer::class,
59+
NewWithBracesFixer::class,
60+
NewWithParenthesesFixer::class,
61+
NotOperatorWithSuccessorSpaceFixer::class,
62+
OperatorLinebreakFixer::class,
63+
PhpdocLineSpanFixer::class,
64+
ExplicitStringVariableFixer::class,
65+
SingleQuoteFixer::class,
66+
ArrayIndentationFixer::class,
67+
BlankLineBetweenImportGroupsFixer::class,
68+
ArrayListItemNewlineFixer::class,
69+
ArrayOpenerAndCloserNewlineFixer::class,
70+
StandaloneLinePromotedPropertyFixer::class,
71+
])
72+
->withCache(__DIR__.'/.build/ecs/')
73+
->withEditorConfig()
74+
// ->withoutParallel()
75+
->withParallel()
76+
->withPhpCsFixerSets(
77+
auto: true,
78+
autoRisky: true,
79+
autoPHPMigration: true,
80+
autoPHPMigrationRisky: true,
81+
autoPHPUnitMigrationRisky: true,
82+
)
83+
->withPreparedSets(
84+
psr12: true,
85+
common: true,
86+
)
87+
// ->withConfiguredRule()
88+
->withRules([
89+
NoUnusedImportsFixer::class,
90+
]);

monorepo-builder.php

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/** @noinspection PhpUnusedAliasInspection */
4+
/** @noinspection UsingInclusionReturnValueInspection */
45

56
declare(strict_types=1);
67

@@ -13,73 +14,10 @@
1314
* @see https://github.com/guanguans/soar-php
1415
*/
1516

16-
use Guanguans\MonorepoBuilderWorker\CreateGithubReleaseReleaseWorker;
17-
use Guanguans\MonorepoBuilderWorker\Support\EnvironmentChecker;
18-
use Guanguans\MonorepoBuilderWorker\UpdateChangelogViaGoReleaseWorker;
19-
use Guanguans\MonorepoBuilderWorker\UpdateChangelogViaNodeReleaseWorker;
20-
use Guanguans\MonorepoBuilderWorker\UpdateChangelogViaPhpReleaseWorker;
21-
use Symfony\Component\Console\Input\ArgvInput;
22-
use Symfony\Component\Console\Output\ConsoleOutput;
23-
use Symfony\Component\Console\Style\SymfonyStyle;
24-
use Symfony\Component\Process\ExecutableFinder;
25-
use Symfony\Component\Process\PhpExecutableFinder;
26-
use Symfony\Component\Process\Process;
2717
use Symplify\MonorepoBuilder\Config\MBConfig;
28-
use Symplify\MonorepoBuilder\Contract\Git\TagResolverInterface;
29-
use Symplify\MonorepoBuilder\Git\BranchAwareTagResolver;
30-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\AddTagToChangelogReleaseWorker;
31-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\PushNextDevReleaseWorker;
32-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\PushTagReleaseWorker;
33-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\SetCurrentMutualDependenciesReleaseWorker;
34-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\SetNextMutualDependenciesReleaseWorker;
35-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\TagVersionReleaseWorker;
36-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateBranchAliasReleaseWorker;
37-
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateReplaceReleaseWorker;
3818

3919
return static function (MBConfig $mbConfig): void {
40-
require __DIR__.'/vendor/autoload.php';
20+
$callback = require __DIR__.'/vendor/guanguans/monorepo-builder-worker/monorepo-builder.php';
21+
$callback($mbConfig);
4122
$mbConfig->defaultBranch('master');
42-
MBConfig::disableDefaultWorkers();
43-
44-
// $services = $mbConfig->services();
45-
// $services->set(BranchAwareTagResolver::class);
46-
// $services->alias(TagResolverInterface::class, BranchAwareTagResolver::class);
47-
48-
/**
49-
* release workers - in order to execute.
50-
*
51-
* @see https://github.com/symplify/monorepo-builder#6-release-flow
52-
*/
53-
$mbConfig->workers($workers = [
54-
// UpdateReplaceReleaseWorker::class,
55-
// SetCurrentMutualDependenciesReleaseWorker::class,
56-
// AddTagToChangelogReleaseWorker::class,
57-
TagVersionReleaseWorker::class,
58-
PushTagReleaseWorker::class,
59-
UpdateChangelogViaGoReleaseWorker::class,
60-
// UpdateChangelogViaNodeReleaseWorker::class,
61-
// UpdateChangelogViaPhpReleaseWorker::class,
62-
CreateGithubReleaseReleaseWorker::class,
63-
// SetNextMutualDependenciesReleaseWorker::class,
64-
// UpdateBranchAliasReleaseWorker::class,
65-
// PushNextDevReleaseWorker::class,
66-
]);
67-
68-
if (!(new ArgvInput)->hasParameterOption('--dry-run', true)) {
69-
(new Process([
70-
(new PhpExecutableFinder)->find(),
71-
(new ExecutableFinder)->find($composer = 'composer', $composer),
72-
'run',
73-
'checks:required',
74-
'--ansi',
75-
]))
76-
->setEnv(['COMPOSER_MEMORY_LIMIT' => -1])
77-
->setTimeout(600)
78-
->mustRun(static function (string $_, string $buffer): void {
79-
$symfonyStyle ??= new SymfonyStyle(new ArgvInput, new ConsoleOutput);
80-
$symfonyStyle->write($buffer);
81-
});
82-
}
83-
84-
EnvironmentChecker::checks($workers);
8523
};

peck.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"dumpable",
88
"runnable"
99
],
10-
"paths": []
10+
"paths": [
11+
"vendor/",
12+
"vendor-bin/"
13+
]
1114
}
1215
}

phpunit.xml.dist

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
bootstrap="vendor/autoload.php"
66
cacheDirectory=".build/phpunit/"
77
cacheResultFile=".build/phpunit/test-results"
@@ -13,6 +13,7 @@
1313
>
1414
<php>
1515
<ini name="error_reporting" value="-1"/>
16+
<!--<env name="SYMFONY_DEPRECATIONS_HELPER" value="/PDO::MYSQL_ATTR_SSL_CA/"/>-->
1617
<env name="DUMP_LIGHT_ARRAY" value=""/>
1718
<env name="DUMP_STRING_LENGTH" value=""/>
1819
<env name="ENV" value="testing"/>
@@ -36,6 +37,7 @@
3637
<directory>tests/</directory>
3738
</testsuite>
3839
</testsuites>
40+
<!--<source ignoreIndirectDeprecations="true">-->
3941
<source>
4042
<include>
4143
<directory>src/</directory>
@@ -45,15 +47,6 @@
4547
<file>src/Support/ComposerScripts.php</file>
4648
</exclude>
4749
</source>
48-
<coverage>
49-
<include>
50-
<directory>src/</directory>
51-
</include>
52-
<exclude>
53-
<directory>src/Support/Rectors/</directory>
54-
<file>src/Support/ComposerScripts.php</file>
55-
</exclude>
56-
</coverage>
5750
<extensions>
5851
<!--<bootstrap class="Ergebnis\PHPUnit\SlowTestDetector\Extension"/>-->
5952
</extensions>

0 commit comments

Comments
 (0)