Skip to content

Keep the formatters away from the generated XCFramework - #40

Merged
HituziANDO merged 1 commit into
mainfrom
fix/lint-staged-exclude-xcframework
Aug 27, 2026
Merged

Keep the formatters away from the generated XCFramework#40
HituziANDO merged 1 commit into
mainfrom
fix/lint-staged-exclude-xcframework

Conversation

@HituziANDO

Copy link
Copy Markdown
Owner

Summary

  • Move the lint-staged configuration to .lintstagedrc.cjs so staged 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

Root cause

The 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.

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

  • Staged one badly formatted header inside the XCFramework and an identical one outside it, then ran npx --no-install lint-staged: the first was left byte-identical, the second was formatted
  • codesign --verify on Framework/SwiftyUpdateKit.xcframework reports valid on disk and satisfies its Designated Requirement
  • No source or test target is affected, so the test suite was not exercised for this change

Notes

The formatters are unchanged; only the file lists they receive are filtered.

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>
@HituziANDO
HituziANDO merged commit eb88dd2 into main Aug 27, 2026
1 check passed
@HituziANDO
HituziANDO deleted the fix/lint-staged-exclude-xcframework branch August 27, 2026 07:40
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.

1 participant