diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-18 01:57:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-18 01:57:02 +0900 |
| commit | 403671544a046f17439e1be8a56931c1904f86cd (patch) | |
| tree | 51d4bad5fc86da15ce7ce0f876f3c2b09ec6507d /scripts/linters/src/Linters/CargoWorkspaceDependencies.php | |
| parent | 90e4f59961a3bfacc37ae4e1a6a6c2b86720bde4 (diff) | |
| download | php-shirabe-403671544a046f17439e1be8a56931c1904f86cd.tar.gz php-shirabe-403671544a046f17439e1be8a56931c1904f86cd.tar.zst php-shirabe-403671544a046f17439e1be8a56931c1904f86cd.zip | |
fix(linters): treat array-of-table headers as section boundaries
The Cargo.toml section-header pattern only matched single-bracket
headers, so a `[[bench]]` / `[[bin]]` / `[[test]]` table left the
previous section active and its keys were attributed to whatever
`[dependencies]` block preceded it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'scripts/linters/src/Linters/CargoWorkspaceDependencies.php')
| -rw-r--r-- | scripts/linters/src/Linters/CargoWorkspaceDependencies.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/linters/src/Linters/CargoWorkspaceDependencies.php b/scripts/linters/src/Linters/CargoWorkspaceDependencies.php index 3ad86b6f..d50b5f42 100644 --- a/scripts/linters/src/Linters/CargoWorkspaceDependencies.php +++ b/scripts/linters/src/Linters/CargoWorkspaceDependencies.php @@ -48,7 +48,7 @@ final class CargoWorkspaceDependencies implements Linter foreach (file($path) as $idx => $rawLine) { $stripped = trim($rawLine); - if (preg_match('/\A\[([^\]]+)\]\z/', $stripped, $m)) { + if (preg_match('/\A\[\[?([^\[\]]+)\]\]?\z/', $stripped, $m)) { $currentSection = $m[1]; continue; } |
