Skip to content

Commit c1d72db

Browse files
authored
chore: update CI/CD configuration and improve code quality (#736)
* chore: update CI/CD configuration and improve code quality
1 parent a0794b7 commit c1d72db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+9309
-3279
lines changed

deptrac.yaml renamed to .ci-tools/deptrac.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
deptrac:
22
paths:
3-
- './src'
3+
- '../src'
44
layers:
55
- name: 'Webauthn'
66
collectors:
77
- type: 'directory'
8-
value: 'src/webauthn/.*'
8+
value: '../src/webauthn/.*'
99
- name: 'UX'
1010
collectors:
1111
- type: 'directory'
12-
value: 'src/stimulus/.*'
12+
value: '../src/stimulus/.*'
1313
- name: 'SymfonyBundle'
1414
collectors:
1515
- type: 'directory'
16-
value: 'src/symfony/.*'
16+
value: '../src/symfony/.*'
1717
- name: 'MetadataService'
1818
collectors:
1919
- type: 'directory'
20-
value: 'src/metadata-service/.*'
20+
value: '../src/metadata-service/.*'
2121
- name: 'Vendors'
2222
collectors:
2323
- { type: classLike, value: '^Cose\\' }

ecs.php renamed to .ci-tools/ecs.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
use PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer;
2020
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
2121
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer;
22+
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer;
2223
use PhpCsFixer\Fixer\ReturnNotation\SimplifiedNullReturnFixer;
2324
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
2425
use PhpCsFixer\Fixer\Strict\StrictComparisonFixer;
2526
use PhpCsFixer\Fixer\Strict\StrictParamFixer;
2627
use PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer;
27-
use PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer;
2828
use PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer;
29+
use Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer;
2930
use Symplify\EasyCodingStandard\Config\ECSConfig;
3031
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
3132

@@ -55,7 +56,6 @@
5556
$config->rule(LinebreakAfterOpeningTagFixer::class);
5657
$config->rule(CombineConsecutiveIssetsFixer::class);
5758
$config->rule(CombineConsecutiveUnsetsFixer::class);
58-
$config->rule(CompactNullableTypehintFixer::class);
5959
$config->rule(NoSuperfluousElseifFixer::class);
6060
$config->rule(NoSuperfluousPhpdocTagsFixer::class);
6161
$config->rule(PhpdocTrimConsecutiveBlankLineSeparationFixer::class);
@@ -84,12 +84,19 @@
8484
'import_constants' => true,
8585
'import_functions' => true,
8686
]);
87+
8788
$config->skip([
88-
MethodChainingIndentationFixer::class => [__DIR__ . '*/DependencyInjection/Configuration.php'],
89+
PhpUnitTestClassRequiresCoversFixer::class,
90+
MethodChainingIndentationFixer::class => [__DIR__ . '/src/Resources/config'],
91+
MethodChainingNewlineFixer::class => [__DIR__ . '/src/Resources/config'],
8992
]);
9093

9194
$config->parallel();
92-
$config->paths(
93-
[__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php', __DIR__ . '/rector.php', __DIR__ . '/castor.php']
94-
);
95+
$config->paths([
96+
__DIR__ . '/../src',
97+
__DIR__ . '/../tests',
98+
__DIR__ . '/../castor.php',
99+
__DIR__ . '/ecs.php',
100+
__DIR__ . '/rector.php',
101+
]);
95102
};

.ci-tools/infection.json.dist

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"source": {
3+
"directories": [
4+
"src"
5+
]
6+
},
7+
"timeout": 3,
8+
"logs": {
9+
"text": "infection.txt"
10+
},
11+
"mutators": {
12+
"@default": true,
13+
"global-ignoreSourceCodeByRegex": [
14+
"\\$this->logger.*",
15+
"\\$this->cache->save.*",
16+
"parent::build(\\$container);"
17+
],
18+
"MBString": {
19+
"settings": {
20+
"mb_substr": false,
21+
"mb_strlen": false
22+
}
23+
}
24+
}
25+
}

.ci-tools/phpbench.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"runner.bootstrap": "../vendor/bootstrap.php",
3+
"runner.path": "../performance",
4+
"runner.progress": "dots",
5+
"runner.time_unit": "microseconds",
6+
"runner.retry_threshold": 10,
7+
"report.generators": {
8+
"full": {
9+
"extends": "aggregate",
10+
"cols": ["benchmark", "subject", "set", "revs", "its", "mem_peak", "best", "mode", "mean", "worst", "stdev", "rstdev"]
11+
},
12+
"simple": {
13+
"extends": "aggregate",
14+
"cols": ["benchmark", "subject", "set", "best", "mean", "worst"]
15+
}
16+
},
17+
"report.outputs": {
18+
"all": {
19+
"renderer": "html",
20+
"file": "report.html",
21+
"title": "Jose Performance Test Suite"
22+
}
23+
}
24+
}

.ci-tools/phpstan-baseline.neon

Lines changed: 7894 additions & 0 deletions
Large diffs are not rendered by default.

.ci-tools/phpstan.neon

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
parameters:
2+
level: max
3+
scanDirectories:
4+
- %rootDir%/../../../../phpunit/vendor
5+
- %currentWorkingDirectory%/vendor
6+
paths:
7+
- %currentWorkingDirectory%/src
8+
banned_code:
9+
non_ignorable: false
10+
checkUninitializedProperties: true
11+
treatPhpDocTypesAsCertain: false
12+
13+
includes:
14+
- %currentWorkingDirectory%/.ci-tools/phpstan-baseline.neon
15+
- %rootDir%/conf/bleedingEdge.neon
16+
- %rootDir%/../../ekino/phpstan-banned-code/extension.neon
17+
- %rootDir%/../phpstan-beberlei-assert/extension.neon
18+
- %rootDir%/../phpstan-deprecation-rules/rules.neon
19+
- %rootDir%/../phpstan-doctrine/extension.neon
20+
- %rootDir%/../../ergebnis/phpstan-rules/rules.neon
21+
- %rootDir%/../phpstan-phpunit/extension.neon
22+
- %rootDir%/../phpstan-strict-rules/rules.neon
23+
- %rootDir%/../phpstan-symfony/extension.neon

.ci-tools/phpunit.xml.dist

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
bootstrap="../tests/bootstrap.php"
5+
colors="true"
6+
xsi:noNamespaceSchemaLocation="phpunit.xsd"
7+
cacheDirectory=".phpunit.cache"
8+
>
9+
<coverage/>
10+
<testsuites>
11+
<testsuite name="Test Suite">
12+
<directory>./../tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<php>
16+
<ini name="display_errors" value="1" />
17+
<ini name="error_reporting" value="-1" />
18+
<server name="APP_ENV" value="test" force="true" />
19+
<server name="SHELL_VERBOSITY" value="-1" />
20+
<server name="KERNEL_CLASS" value="Webauthn\Tests\Bundle\Functional\AppKernel"/>
21+
</php>
22+
<source>
23+
<include>
24+
<directory>./../src</directory>
25+
</include>
26+
<exclude>
27+
<file>../src/symfony/src/Controller/DummyController.php</file>
28+
<file>../src/symfony/src/Controller/DummyControllerFactory.php</file>
29+
<file>../src/symfony/src/Repository/DummyPublicKeyCredentialSourceRepository.php</file>
30+
<file>../src/symfony/src/Repository/DummyPublicKeyCredentialUserEntityRepository.php</file>
31+
</exclude>
32+
</source>
33+
<extensions>
34+
<bootstrap class="Ergebnis\PHPUnit\SlowTestDetector\Extension"/>
35+
</extensions>
36+
</phpunit>

0 commit comments

Comments
 (0)