Keep the formatters away from the generated XCFramework - #40
Merged
Conversation
The lint-staged globs in package.json matched every .h in the repository, including the generated headers inside Framework/SwiftyUpdateKit.xcframework. Committing a regenerated artifact therefore ran uncrustify over those headers, which realigned their #define directives and reordered their #include lines. Because the rewrite happened after build.sh signed the bundle, codesign --verify then reported the files as modified. - Move the configuration to .lintstagedrc.cjs so the file lists can be filtered, and drop the lint-staged key from package.json. - Skip any staged path under Framework/SwiftyUpdateKit.xcframework/, and run no command at all when nothing else remains. - Record the constraint in AGENTS.md so the globs are not widened again. Verified by staging one header inside the XCFramework and one outside it: the first was left byte-identical and the second was still formatted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4 tasks
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
.lintstagedrc.cjsso staged file lists can be filtered, and drop thelint-stagedkey frompackage.jsonFramework/SwiftyUpdateKit.xcframework/, and run no command at all when nothing else remainsAGENTS.mdso the globs are not widened againRoot cause
The globs in
package.jsonmatched every.hin the repository, including the generated headers insideFramework/SwiftyUpdateKit.xcframework. Committing a regenerated artifact therefore ran uncrustify over those headers, which realigned their#definedirectives and reordered their#includelines. Because the rewrite happened afterbuild.shsigned the bundle,codesign --verifythen reported the files as modified.This was hit while preparing 1.5.1: the first release commit contained a corrupted, invalidly signed XCFramework. It was repaired before tagging by restoring the headers from the archive output and re-signing.
Validation
npx --no-install lint-staged: the first was left byte-identical, the second was formattedcodesign --verifyonFramework/SwiftyUpdateKit.xcframeworkreports valid on disk and satisfies its Designated RequirementNotes
The formatters are unchanged; only the file lists they receive are filtered.