Skip to content

Run swift-format before compilation - #14

Merged
backslash-f merged 4 commits into
mainfrom
codex/swift-format-build-phase
Jul 24, 2026
Merged

Run swift-format before compilation#14
backslash-f merged 4 commits into
mainfrom
codex/swift-format-build-phase

Conversation

@backslash-f

@backslash-f backslash-f commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a reusable format-and-lint command and guidance for a pre-compilation Xcode build phase
  • document the shared swift-format customization policy and link the official rule reference
  • enable ValidateDocumentationComments plus four conservative SwiftLint-aligned rules
  • prevent duplicate manual Codex review requests when automatic review is enabled
  • prepare the shared guidance release as version 0.0.11

Rule review

Enabled beyond the Xcode 27 dump:

  • AlwaysUseLiteralForEmptyCollectionInit
  • NeverUseForceTry
  • NoEmptyLinesOpeningClosingBraces
  • UseWhereClausesInForLoops
  • ValidateDocumentationComments

The guide records deliberately deferred rules and notes that repository-specific import bans and sorted enum cases have no swift-format equivalent.

Validation

  • python3 -m unittest discover -s Tests
  • python3 Scripts/validate_guidelines.py
  • bash -n Scripts/swift_format.sh
  • git diff --check
  • compared the complete 43-rule configuration with xcrun swift-format dump-configuration
  • exercised format-and-lint and lint-strict with an incomplete documentation fixture; warnings remained non-blocking locally and strict lint failed as expected

@backslash-f

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9af42b9887

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Guidelines/Swift/SwiftFormat.md Outdated
Comment thread Scripts/validate_guidelines.py Outdated
@backslash-f
backslash-f merged commit 38f4736 into main Jul 24, 2026
1 check passed
@backslash-f
backslash-f deleted the codex/swift-format-build-phase branch July 24, 2026 23:45
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

Successfully merging this pull request may close these issues.

1 participant