Skip to content

Commit e6c6b5a

Browse files
committed
Merge branch '2.1.x' into grouped-error-formatter
# Conflicts: # conf/config.neon
2 parents c2ca50d + d817de5 commit e6c6b5a

File tree

1,450 files changed

+24161
-10242
lines changed

Some content is hidden

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

1,450 files changed

+24161
-10242
lines changed

.github/renovate.json

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,76 @@
11
{
22
"extends": [
3-
"config:base",
3+
"config:recommended",
44
"schedule:weekly"
55
],
66
"dependencyDashboard": true,
77
"rangeStrategy": "update-lockfile",
88
"rebaseWhen": "conflicted",
9-
"baseBranches": ["2.1.x"],
9+
"baseBranches": [
10+
"2.1.x"
11+
],
1012
"packageRules": [
1113
{
12-
"matchPackagePatterns": ["*"],
13-
"enabled": false
14+
"enabled": false,
15+
"matchPackageNames": [
16+
"*"
17+
]
1418
},
1519
{
16-
"matchPaths": ["+(composer.json)"],
20+
"matchFileNames": [
21+
"+(composer.json)"
22+
],
1723
"enabled": true,
18-
"matchBaseBranches": ["2.1.x"]
24+
"matchBaseBranches": [
25+
"2.1.x"
26+
]
1927
},
2028
{
21-
"matchPaths": ["build-cs/**"],
29+
"matchFileNames": [
30+
"build-cs/**"
31+
],
2232
"enabled": true,
2333
"groupName": "build-cs"
2434
},
2535
{
26-
"matchPaths": ["apigen/**"],
36+
"matchFileNames": [
37+
"apigen/**"
38+
],
2739
"enabled": true,
2840
"groupName": "apigen"
2941
},
3042
{
31-
"matchPaths": ["issue-bot/**"],
32-
"enabled": true,
33-
"groupName": "issue-bot"
43+
"matchFileNames": [
44+
"issue-bot/**"
45+
],
46+
"enabled": true,
47+
"groupName": "issue-bot"
3448
},
3549
{
36-
"matchPaths": ["changelog-generator/**"],
50+
"matchFileNames": [
51+
"changelog-generator/**"
52+
],
3753
"enabled": true,
3854
"groupName": "changelog-generator"
3955
},
4056
{
41-
"matchPaths": ["compiler/**"],
57+
"matchFileNames": [
58+
"compiler/**"
59+
],
4260
"enabled": true,
4361
"groupName": "compiler"
4462
},
4563
{
46-
"matchPaths": [".github/**"],
64+
"matchFileNames": [
65+
"tests/composer.json"
66+
],
67+
"enabled": true,
68+
"groupName": "paratest"
69+
},
70+
{
71+
"matchFileNames": [
72+
".github/**"
73+
],
4774
"enabled": true,
4875
"groupName": "github-actions"
4976
}

.github/scripts/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.github/scripts/diffPrefixes.php

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php declare(strict_types = 1);
2+
3+
use Nette\Utils\Strings;
4+
use SebastianBergmann\Diff\Differ;
5+
6+
require_once __DIR__ . '/../../vendor/autoload.php';
7+
8+
$diffFile = $argv[1] ?? null;
9+
$oldDir = $argv[2] ?? null;
10+
$newDir = $argv[3] ?? null;
11+
if ($diffFile === null || !is_file($diffFile)) {
12+
exit(1);
13+
}
14+
15+
if ($oldDir === null || !is_dir($oldDir)) {
16+
exit(1);
17+
}
18+
19+
if ($newDir === null || !is_dir($newDir)) {
20+
exit(1);
21+
}
22+
23+
$diffLines = explode("\n", file_get_contents($diffFile));
24+
$differ = new Differ(new \SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder('', true));
25+
$isDifferent = false;
26+
foreach ($diffLines as $diffLine) {
27+
$operation = $diffLine[0];
28+
if ($operation === ' ') {
29+
continue;
30+
}
31+
32+
$pathWithLine = substr($diffLine, 1);
33+
$pathParts = explode(':', $pathWithLine);
34+
$path = $pathParts[0];
35+
$lineNumber = $pathParts[1] ?? null;
36+
if ($lineNumber === null) {
37+
continue;
38+
}
39+
$oldFilePath = $oldDir . '/' . $path;
40+
if (!is_file($oldFilePath)) {
41+
continue;
42+
}
43+
44+
$newFilePath = $newDir . '/' . $path;
45+
if (!is_file($newFilePath)) {
46+
continue;
47+
}
48+
49+
$stringDiff = $differ->diff(file_get_contents($oldFilePath), file_get_contents($newFilePath));
50+
if ($stringDiff === '') {
51+
continue;
52+
}
53+
54+
$isDifferent = true;
55+
56+
echo "$path:\n";
57+
$startLine = 1;
58+
$startContext = 1;
59+
foreach (explode("\n", $stringDiff) as $i => $line) {
60+
$matches = Strings::match($line, '/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@/');
61+
if ($matches !== null) {
62+
$startLine = (int) $matches[1];
63+
$startContext = (int) $matches[2];
64+
continue;
65+
}
66+
67+
if ($lineNumber < $startLine || $lineNumber > ($startLine + $startContext)) {
68+
continue;
69+
}
70+
71+
if (str_starts_with($line, '+')) {
72+
echo "\033[32m$line\033[0m\n";
73+
} elseif (str_starts_with($line, '-')) {
74+
echo "\033[31m$line\033[0m\n";
75+
} else {
76+
echo "$line\n";
77+
}
78+
}
79+
80+
echo "\n";
81+
}
82+
83+
if ($isDifferent) {
84+
exit(1);
85+
}

.github/scripts/find-artifact.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import * as core from "@actions/core";
2+
import * as github from "@actions/github";
3+
4+
interface Inputs {
5+
github: ReturnType<typeof github.getOctokit>;
6+
context: typeof github.context;
7+
core: typeof core;
8+
}
9+
10+
module.exports = async ({github, context, core}: Inputs) => {
11+
const commitSha = process.env.BASE_SHA;
12+
const artifactName = process.env.ARTIFACT_NAME;
13+
const workflowName = process.env.WORKFLOW_NAME;
14+
15+
// Get all workflow runs for this commit
16+
const runs = await github.rest.actions.listWorkflowRunsForRepo({
17+
owner: context.repo.owner,
18+
repo: context.repo.repo,
19+
per_page: 20,
20+
event: "push",
21+
head_sha: commitSha
22+
});
23+
24+
if (runs.data.workflow_runs.length === 0) {
25+
core.setFailed(`No workflow runs found for commit ${commitSha}`);
26+
return;
27+
}
28+
29+
const workflowRuns = runs.data.workflow_runs;
30+
if (workflowRuns.length === 0) {
31+
core.setFailed(`No workflow runs found for commit ${commitSha}`);
32+
return;
33+
}
34+
35+
let found = false;
36+
for (const run of workflowRuns) {
37+
if (run.status !== "completed" || run.conclusion !== "success") {
38+
continue;
39+
}
40+
41+
if (run.name !== workflowName) {
42+
continue;
43+
}
44+
45+
const artifactsResp = await github.rest.actions.listWorkflowRunArtifacts({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
run_id: run.id,
49+
});
50+
51+
const artifact = artifactsResp.data.artifacts.find(a => a.name === artifactName);
52+
if (artifact) {
53+
core.setOutput("artifact_id", artifact.id.toString());
54+
core.setOutput("run_id", run.id.toString());
55+
found = true;
56+
break;
57+
}
58+
}
59+
60+
if (!found) {
61+
core.setFailed(`No artifact named '${artifactName}' found for commit ${commitSha}`);
62+
}
63+
}

.github/scripts/listPrefix.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php declare(strict_types = 1);
2+
3+
require_once __DIR__ . '/../../vendor/autoload.php';
4+
5+
$dir = $argv[1] ?? __DIR__;
6+
$iterator = new RecursiveDirectoryIterator($dir);
7+
$iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS);
8+
$files = new RecursiveIteratorIterator($iterator);
9+
10+
$locations = [];
11+
foreach ($files as $file) {
12+
$path = $file->getPathname();
13+
if ($file->getExtension() !== 'php') {
14+
continue;
15+
}
16+
$contents = file_get_contents($path);
17+
$lines = explode("\n", $contents);
18+
foreach ($lines as $i => $line) {
19+
if (!str_contains($line, '_PHPStan_checksum')) {
20+
continue;
21+
}
22+
23+
$trimmedPath = substr($path, strlen($dir) + 1);
24+
if (str_starts_with($trimmedPath, 'vendor/composer/autoload_')) {
25+
continue;
26+
}
27+
$locations[] = $trimmedPath . ':' . ($i + 1);
28+
}
29+
}
30+
sort($locations);
31+
echo implode("\n", $locations);
32+
echo "\n";

0 commit comments

Comments
 (0)