Repository navigation
Add a verify mode to xcprojformatter - #30
Open
zachshallbetter wants to merge 1 commit into
Open
zachshallbetter wants to merge 1 commit into
zachshallbetter wants to merge 1 commit into
Conversation
zachshallbetter
requested review from
deccylol,
jakepetroules,
jonathanjhess,
owenv and
rconnell9
as code owners
November 24, 2026 06:52
This was referenced Nov 24, 2026
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.
Type of change
xcprojformatter(CLI) changeSummary
Adds a
--verifymode toxcprojformatterfor CI checks. It formats the input in memory and compares the result byte for byte with the original input, exiting0on an exact match and1if formatting would change anything, with emptystdoutand without modifying the input file.Per the discussion on #20, this starts with just exit codes rather than diff output.
Related issue
Fixes #20
Changes
Sources/Tool/Arguments.swift: Added--verifyand rejected combining it with--outputor--update.Sources/Tool/main.swift: Added the--verifypath using existing input handling (--input, positional path,.xcodeproj,project.xcproj, andstdin) and byte-for-byte comparison.Sources/Tool/Help.swift: Documented--verifyin--help.Sources/Tests/VerifyCommandTests.swift: Added--verifytests covering canonical input, trailing-newline mismatch, malformed/missing input, and conflicting output flags.Testing
swift test)swift test(36 tests passing),swift build -c release, and verified--helpand0/1exit codes on the builtxcprojformatterbinary.Checklist