Repository navigation
Warn on unknown spec keys - #1673
Merged
Merged
Conversation
This was referenced Nov 19, 2026
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
…dividually, document Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
yonaskolb
force-pushed
the
claude/project-thread-2sp31z
branch
from
November 25, 2026 06:28
93e1e8e to
07f1b9a
Compare
yonaskolb
marked this pull request as ready for review
November 25, 2026 06:29
…keys - Mark a target's deploymentTarget as read when it's a per-platform map, and decode the map in its own scope so typos in it are reported - Run the remaining loadable fixture specs through testFixturesHaveNoUnknownKeys - Test that YAML anchors and merge keys don't produce warnings Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKr4VbX6fkZgBHoh2DT
yonaskolb
pushed a commit
that referenced
this pull request
Nov 25, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01237XKu4FYZRdEg2D5963qC
This was referenced Nov 25, 2026
Closed
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 every spec key it never reads, at every level, instead of silently ignoring it:
Fixes #1645 and #1526. This is an alternative to #1660, #1661 and #1528, which keep hand-written lists of valid keys. It uses key read tracking from JSONUtilities 4.3.0 (yonaskolb/JSONUtilities#1) instead, so there's no list to keep in sync. These are warnings only, and generation still continues.
Changes
from: "4.3.0".SpecLoaderdecodes the project insideKeyAccessTracking.record, andvalidateProjectDictionaryWarningsreports each unused key asSpecValidationError.ValidationError.unknownKey.generateprints each validation warning on its own line with aWarning:prefix, instead of one "Spec validation error:" block.x-are never reported, so they can hold YAML anchors.targetTemplatesandschemeTemplatestemplates,templateAttributes,platformPrefix,platformSuffixand__declarationIndextemplatesandtemplateAttributestestTargets,coverageTargets, scheme testtargets, environment variablevalueand settingsconfigs.settingsmark all their keys as read, since they're build settings.["sources", .index(i)], so their keys are checked too. That covers target sources, test targets, coverage targets, test plans, environment variables,buildPhaseand dependencycopy.Caught a real typo
Tests/Fixtures/TestProject/project.ymlhadstopOnStype: Catchon an exception breakpoint, so the breakpoint was silently generated with the defaultthrow. It's nowstopOnStyle, and the fixture'sBreakpoints_v2.xcbkptlisthasstopOnStyle = "1".The
testSpecWarningValidationtests also used a top-leveltemplates:key that doesn't exist. They now usetargetTemplates:.Docs
ProjectSpec.mdmentions the warning and thex-prefix.CONTRIBUTING.mdexplainsmarkRead,markAllReadandscopefor anyone adding spec options.Tests
testUnknownKeyWarningschecks that typos are reported with their paths. It covers the top level, options, settings, a target, a source entry, a dependency, a scheme and a scheme test target.x-keys, settings, plist properties, attributes, environment variables and command line arguments.testFixturesHaveNoUnknownKeysloads 9 fixture specs and expects no unknown keys. Any spec key that's parsed in a way the tracking can't see will fail CI.