Merge pull request #33218 from BenjaminFlr/precommitreadme

ADD MacOS case in pre-commit README.md file
This commit is contained in:
Laurent Destailleur 2025-02-26 16:15:20 +01:00 committed by GitHub
commit 5aebac07ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,8 @@ the project: `pre-commit-config.yaml`.
### Installation in your git project
If you're running MacOS, you can use [homebrew](https://brew.sh/) as a package manager
1. Install pre-commit tool.\
If you do not have python installed, install [python](https://www.python.org) first.\
`sudo apt install python3`
@ -38,6 +40,11 @@ the project: `pre-commit-config.yaml`.
Then install phpcbf and phpcs:\
`sudo apt install php-codesniffer`
If you're running MacOS, you can follow the steps above by replacing the commands by the following:\
Install [pipx](https://pipx.pypa.io/latest/installation/): `brew install pipx` and then `pipx ensurepath`\
Install pre-commit tool: `pipx install pre-commit\
Install phpcbf and phpcs: `brew install php-codesniffer`\
3. In your local git clone of the project, run `pre-commit install` to add the hooks
or copy the file *dev/setup/git/hooks/pre-commit* manually into *.git/hooks/pre-commit*
(recommended because this file may differ from the file installed with the pre-commit install).