Repository navigation
Make swift:lint work with SwiftLint 0.65.1's relative baseline paths - #843
Merged
Merged
Conversation
SwiftLint before 0.65.1 wrote baseline locations as absolute file:// URLs (realm/SwiftLint#6812), so swift-lint-baseline.mjs converted them to repo-relative paths on write and back to file:// URLs before every lint. 0.65.1 writes and matches plain paths relative to the working directory, so on it every expanded entry missed: swift:lint reported all 175 grandfathered violations on unchanged main, and writing the baseline threw "Invalid URL". scripts/swift-lint.mjs replaces swift-lint.sh and swift-lint-baseline.mjs. lint passes .swiftlint-baseline.json to SwiftLint as committed; write sorts the entries and their keys (SwiftLint's key order changes between runs) so regenerating is byte-stable. Both refuse SwiftLint older than 0.65.1 with an upgrade hint. The end-to-end tests now run in the repo's tmp/: SwiftLint can't match relative baseline paths under macOS's /private/var temp dirs. While lint couldn't run, main drifted: AppEnvironment.init grew to 83 lines, so it is shortened to 80, and the baseline is regenerated. Besides the one-time key reorder, it only shortens, moves or drops entries. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bun run swift:lintfailed on unchangedmainfor anyone on SwiftLint 0.65.1, the current release. It reported every grandfathered violation again. Since CI doesn't run SwiftLint, the pre-commit hook was the only gate, and it had to be bypassed.file://URLs, soswift-lint-baseline.mjsconverted paths on write and converted them back before every lint. 0.65.1 fixed that (realm/SwiftLint#6812) and now writes and matches plain relative paths. The conversion broke every match, and writing a baseline threw "Invalid URL".scripts/swift-lint.mjsreplacesswift-lint.shandswift-lint-baseline.mjs.lintpasses.swiftlint-baseline.jsonto SwiftLint unchanged.writesorts entries and keys. SwiftLint's key order changes from run to run, so this keeps regeneration byte-stable.brew upgrade swiftlinthint.tmp/, because SwiftLint can't match relative paths under macOS's/private/vartemp directories.AppEnvironment.initgrew from 82 to 83 lines in Generate landing and App Store screenshots from the real app #834 while lint couldn't run. It's now 80, by collapsing one call onto one line. The baseline is regenerated: apart from a one-time key reorder, it only shortens, moves or drops entries. It drops 4 stale entries, andAppStoreScreenshotTestsgoes from 68 to 67.Test plan
bun run swift:lintpasses, and a fakeswiftlintreporting 0.65.0 is rejected with the upgrade hintnode --test scripts/swift-lint.test.mjs scripts/check-plan.test.mjs;dev:scripts:testis now fully greenswift:lint:baselinerun twice gives byte-identical outputCodevisorCorebuild,swift:build:iostest:coveragehit 5-second test timeouts in@codevisor/processesand@codevisor/worktreesat load average ~300–360. Neither package is touched here, andprocessespasses 36/36 when run alone. Committed with--no-verifyfor that reason.🤖 Generated with Claude Code