Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to fail loudly if run produces diff #1064

Open
ZevEisenberg opened this issue Jun 2, 2023 · 0 comments
Open

Add ability to fail loudly if run produces diff #1064

ZevEisenberg opened this issue Jun 2, 2023 · 0 comments

Comments

@ZevEisenberg
Copy link
Contributor

ZevEisenberg commented Jun 2, 2023

Sometimes, a change to an asset catalog gets committed without the corresponding swiftgen command generating source code for it. I have a pre-commit hook, but for whatever reason, sometimes that gets skipped. I don't want to run SwiftGen during every Xcode build for performance reasons.

What I want is to be able to run SwiftGen on my CI server with a --dry-run or --fail-if-diffs mode; something that I can use to fail the build if SwiftGen's output produces any changes. I think the best I can do right now is to run SwiftGen on CI, and then use something like git diff HEAD --exit-code --quiet to see if it produced any changes.

(n.b. git diff HEAD will catch both staged and un-staged files.)

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

No branches or pull requests

1 participant