Repository navigation
Conversation
Records which keys are read while decoding the spec and warns about any key that was never read, with its path, e.g. targets.App.resources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
…dividually, document Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
This branch has not been deployed
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.
Requested by Yonas · project thread
XcodeGen now warns about any spec key it never reads, at every level, instead of silently ignoring it:
Fixes #1645 and #1526. Alternative to #1660, #1661 and #1528, which keep hand-written lists of valid keys; this uses key read tracking from yonaskolb/JSONUtilities#1, so there is no list to keep in sync. Generation still continues; these are warnings only.
Draft until JSONUtilities#1 is merged and released:
Package.swiftcurrently points at itskey-access-trackingbranch and needs switching to the release (e.g.from: "4.3.0").Changes
SpecLoaderdecodes the project insideKeyAccessTracking.record, andvalidateProjectDictionaryWarningsreports each unused key asSpecValidationError.ValidationError.unknownKey.generateprints each validation warning on its own line with aWarning:prefix, rather than one "Spec validation error:" block.x-are never reported, so they can hold YAML anchors.targetTemplates/schemeTemplates, targettemplates/templateAttributes/platformPrefix/platformSuffix/__declarationIndex, schemetemplates/templateAttributes.testTargets,coverageTargets, scheme testtargets, environment variablevalue, settingsconfigs), and flatsettingsmark all keys read since they're build settings.buildPhaseand dependencycopy.Caught a real typo
Tests/Fixtures/TestProject/project.ymlhadstopOnStype: Catchon an exception breakpoint, so it was silently generated with the defaultthrow. Fixed tostopOnStyle, and the fixture'sBreakpoints_v2.xcbkptlistnow hasstopOnStyle = "1". ThetestSpecWarningValidationtests also used a top-leveltemplates:key that doesn't exist; changed totargetTemplates:.Docs
ProjectSpec.mdmentions the warning and thex-prefix.CONTRIBUTING.mdexplainsmarkRead,markAllReadandscopefor anyone adding spec options.Tests
testUnknownKeyWarnings: typos at the top level, in options, settings, a target, a source entry, a dependency, a scheme and a scheme test target are all reported with their paths; template, multi-platform,x-, settings, plist properties, attributes, environment variables and command line arguments keys are not.testFixturesHaveNoUnknownKeys: 9 fixture specs load with no unknown keys, so any spec key that's parsed in a way the tracking can't see fails CI.swift testpasses on Swift 6.4 / Xcode 27, with the fixture regenerated with no diff.Generated by Claude Code