Why? Developers function is to code and shouldn't care about formatting. So why not apply styling and linting in a pre-commit-hook?
This repository provides pre-commit hooks designed specifically for iOS development. These hooks help automate code quality checks and enforce coding standards, ensuring a smoother development experience.
- Automates code quality checks.
- Ensures adherence to coding standards.
- Identifies and resolves common issues before committing changes.
- The formatting and linting where based on Apple's open source projects
To use this project, you need to have the pre-commit framework installed. Below are instructions for installing it using either Homebrew or Pyenv.
-
Open your terminal.
-
Run the following command to install
pre-commit:brew install pre-commit
-
Confirm the installation:
pre-commit --version
-
Make sure you have Python installed via Pyenv. If not, follow the Pyenv installation guide.
-
Install a Python version using Pyenv:
pyenv install <version> # Replace <version> with the desired Python version, e.g., 3.9.9 pyenv global <version> # Set the installed version as the global default
-
Ensure
pipis available:pyenv exec python -m ensurepip --upgrade -
Use
pipto installpre-commit:pip install pre-commit
-
Confirm the installation:
pre-commit --version
Once the pre-commit framework is installed, set up the hooks by following these steps:
-
Open your terminal.
-
Run the following command:
curl -sSL https://raw.githubusercontent.com/brunogama/ios-pre-commit-hooks/main/install | bash -
This command will:
- Download the necessary files.
- Execute the
install-hooksscript to set up your pre-commit environment.
Contributions are welcome! If you encounter issues or have suggestions for improvement, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Let me know if you'd like further refinements!