chore: check formatting in CI, and stop pacing failures being UB - #135
Merged
Conversation
`zig fmt` was never enforced, and eight files had drifted. CI now runs `zig fmt --check` over src, tests, examples and build.zig, and those files are formatted. Frame pacing used `catch unreachable` on the deadline wait. A wait can fail -- a cancelled or interrupted sleep -- and `unreachable` on that path is undefined behaviour in a release build, for something whose only consequence is one unpaced frame. It now continues instead. Removes `sleepNs`, which nothing called.
On a filesystem that cannot hold extended attributes -- exFAT, NTFS, most network shares -- macOS writes a `._name` sidecar next to every file it touches. They are metadata for files that are already tracked, they appear in their thousands, and a `git add` of a directory sweeps them straight into a commit.
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.
Small cleanups from the codebase review.
zig fmtin CIFormatting was never enforced, and eight files had drifted (
tests/unicode_tests.zigand seven examples). CI now runszig fmt --check src tests examples build.zig, and those files are formatted — the whole diff outside the workflow is 52 lines of whitespace.catch unreachableon the frame-pacing waitA wait can fail — a cancelled or interrupted sleep.
unreachableon that path is undefined behaviour in a release build, and the only consequence of the failure is that one frame goes unpaced. It now continues instead.Dead code
sleepNshad no callers.zig build testandzig buildclean on 0.16.0.