Skip to content

fix: ignore hidden and build directories in unicode lint test - #565

Merged
SuperCoolPencil merged 2 commits into
mainfrom
fix-issue-557
Jul 29, 2026
Merged

fix: ignore hidden and build directories in unicode lint test#565
SuperCoolPencil merged 2 commits into
mainfrom
fix-issue-557

Conversation

@SuperCoolPencil

@SuperCoolPencil SuperCoolPencil commented Jul 29, 2026

Copy link
Copy Markdown
Member

Fixes #557

This PR updates the TestNoRawUnicodeInStringLiterals lint rule to explicitly ignore directories starting with . or _. This prevents the test from incorrectly scanning third-party dependencies downloaded by packaging tools (like Void Linux's xbps-src which creates _build-surge-xbps) during package builds.

Greptile Summary

Updates the unicode string-literal lint walk to skip hidden and underscore-prefixed directories while still scanning the module root.

  • Removes hard-coded .git from skipDirs in favor of a general . / _ name prefix skip for non-root directories.
  • Explicitly does not skip the walk root so packaging workdirs like _build-surge-xbps that hold go.mod still have their tree scanned.

Confidence Score: 5/5

The PR appears safe to merge; the walk-root skip issue is fixed and no blocking failure remains.

The walk root is returned without SkipDir before prefix checks, so module roots named like _build-surge-xbps are still traversed and production .go files are linted as intended.

Files Needing Attention: No files need further attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran a general contract validation to compare the behavior of ordinary-descendant/raw_unicode_fixture.go before and after changes.
  • Confirmed that the before state produced the expected raw-Unicode violation.
  • Confirmed that the after state with fixtures beneath dot- and underscore-prefixed descendants produced no violations.
  • Used a reusable fixture and the executed harness to ensure traceability of the validation.
  • Collected and linked the supporting artifacts (logs and scripts) as evidence for review.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
internal/lint/unicode_lint_test.go WalkDir now skips ./_-prefixed child dirs and vendor/testdata, but never skips the project root, addressing the prior packaging false-pass.

Reviews (2): Last reviewed commit: "fix: prevent accidental skipping of the ..." | Re-trigger Greptile

This prevents the test from incorrectly failing when build systems
(like Void Linux's xbps-src) create hidden or build directories
(e.g., _build-surge-xbps) that contain third-party dependencies
with raw unicode characters.
@github-actions

Copy link
Copy Markdown

❌ Test Failures on macos-latest

  • github.com/SurgeDM/Surge/internal/service: TestLocalDownloadService_AddWithID_UsesProvidedID

@SuperCoolPencil
SuperCoolPencil merged commit ca779d9 into main Jul 29, 2026
14 of 15 checks passed
@SuperCoolPencil
SuperCoolPencil deleted the fix-issue-557 branch July 29, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestNoRawUnicodeInStringLiterals test failed on CI

1 participant