Description:
On Windows, internal/tools/verifyreadmes does not exclude hidden dot-directories like .hidden, even though the current exclusion logic skips them on slash-separated platforms.
Steps to Reproduce:
-
Check out main at b05b3d3bd.
-
From PowerShell in the repository root, run:
$root = Join-Path $env:TEMP 'otel-verifyreadmes-hidden'
Remove-Item -Recurse -Force $root -ErrorAction SilentlyContinue
$mod = Join-Path $root '.hidden\mod'
New-Item -ItemType Directory -Force -Path $mod | Out-Null
Set-Content -Path (Join-Path $mod 'go.mod') -Value "module example.com/hidden`ngo 1.25.0`n"
go run ./internal/tools/verifyreadmes $root
Actual Behavior:
The tool exits non-zero and reports a missing README.md inside the hidden directory instead of skipping it.
Example output:
Verifying READMEs in C:\Users\<user>\AppData\Local\Temp\otel-verifyreadmes-hidden
Some readme files couldn't be found.
couldn't find README.md for "C:\\Users\\<user>\\AppData\\Local\\Temp\\otel-verifyreadmes-hidden\\.hidden\\mod"
Expected Behavior:
Hidden dot-directories should be excluded consistently on Windows as well, so .hidden\mod\go.mod should be skipped and the command should succeed.
Notes:
This appears to come from excludedDirs containing "/." while verifyReadme checks strings.Contains(path, dir) against OS-native paths. On Windows, the walked path uses \, so paths like C:\...\\.hidden\\mod\\go.mod never match the "/." exclusion.
This affects the internal verifyreadmes tool used by make verify-readmes and make precommit.
Description:
On Windows,
internal/tools/verifyreadmesdoes not exclude hidden dot-directories like.hidden, even though the current exclusion logic skips them on slash-separated platforms.Steps to Reproduce:
Check out
mainatb05b3d3bd.From PowerShell in the repository root, run:
Actual Behavior:
The tool exits non-zero and reports a missing
README.mdinside the hidden directory instead of skipping it.Example output:
Expected Behavior:
Hidden dot-directories should be excluded consistently on Windows as well, so
.hidden\mod\go.modshould be skipped and the command should succeed.Notes:
This appears to come from
excludedDirscontaining"/."whileverifyReadmechecksstrings.Contains(path, dir)against OS-native paths. On Windows, the walked path uses\, so paths likeC:\...\\.hidden\\mod\\go.modnever match the"/."exclusion.This affects the internal
verifyreadmestool used bymake verify-readmesandmake precommit.