A toolset for iOS teams to automatically enforce Objective-C code formatting via git hooks and clang-format.
Space Commander is a toolset that automates Objective-C code formatting for iOS development teams using git hooks and clang-format. It ensures all commits adhere to a unified style without manual effort, solving the problem of inconsistent formatting in collaborative projects. The project originated at Square to streamline iOS development and pull request processes.
iOS development teams working with Objective-C who want to enforce consistent code formatting automatically. It's particularly valuable for organizations with multiple developers contributing to shared repositories.
Developers choose Space Commander because it eliminates manual formatting work and style debates, integrating seamlessly into git workflows. Its flexibility allows teams to customize formatting rules while providing robust automation for both local commits and CI/CD pipelines.
Commit fully-formatted Objective-C as a team without even trying.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Installs pre-commit hooks that block unformatted code, eliminating manual style checks during commits as described in the setup-repo.sh script.
Provides scripts like format-objc-file.sh for individual files and format-objc-files-in-repo.sh for entire repositories, with dry-run options for flexibility.
Can be configured to fail builds or pull requests if unformatted code is detected, using hooks like format-objc-mobuild for CI/CD pipelines.
Allows teams to modify .clang-format or add custom formatters in the custom/ directory, enabling tailored styles beyond clang-format's limitations.
Only supports Objective-C, with no built-in functionality for Swift or other iOS languages, limiting its utility in modern mixed-codebases.
Pull request validation instructions are Square-specific to mobuild, requiring significant adaptation for other build systems like Jenkins or GitHub Actions.
The README admits occasional undesirable outputs, forcing developers to use exemptions like // clang-format off or refactor code manually.
Adding custom formatters requires editing shell scripts and testing with Testing Support files, which can be technical and error-prone for teams.