Skip to content

Instantly share code, notes, and snippets.

@wrkhenddher
Last active January 12, 2024 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrkhenddher/cf595cb3565ee277ee11b5d52db637c7 to your computer and use it in GitHub Desktop.
Save wrkhenddher/cf595cb3565ee277ee11b5d52db637c7 to your computer and use it in GitHub Desktop.
Homebrew pre-commit 2.21.0 (3.x.x breaks with existing .pre-commit-config.yaml)
```shell
$ brew tap-new $USER/local--pre-commit
```
```shell
Initialized empty Git repository in /opt/homebrew/Library/Taps/henddher/homebrew-local--pre-commit/.git/
`.pre-commit-config.yaml` config file not found. Skipping `pre-commit`.
[main (root-commit) 5f52df2] Create henddher/local--pre-commit tap
3 files changed, 90 insertions(+)
create mode 100644 .github/workflows/publish.yml
create mode 100644 .github/workflows/tests.yml
create mode 100644 README.md
==> Created henddher/local--pre-commit
/opt/homebrew/Library/Taps/henddher/homebrew-local--pre-commit
When a pull request making changes to a formula (or formulae) becomes green
(all checks passed), then you can publish the built bottles.
To do so, label your PR as `pr-pull` and the workflow will be triggered.
```
```shell
file "$(brew --repo homebrew/core)"
```
*IF*
```
/opt/homebrew/Library/Taps/homebrew/homebrew-core: cannot open `/opt/homebrew/Library/Taps/homebrew/homebrew-core' (No such file or directory)
```
*THEN*
```shell
brew tap homebrew/core
```
*FI*
```shell
brew extract --version=2.21.0 pre-commit $USER/local--pre-commit
```
```shell
brew search pre-commit
==> Formulae
henddher/local--pre-commit/pre-commit@2.21.0 pre-commit ✔
```
*IF*
```shell
pre-commit --version
```
```
pre-commit 3.2.2
```
*THEN*
```shell
brew unlink pre-commit
```
```
Unlinking /opt/homebrew/Cellar/pre-commit/3.2.2... 1 symlinks removed.
```
*FI*
```shell
brew install pre-commit@2.21.0
```
```
brew link pre-commit@2.21.0
```
```shell
pre-commit --version
```
```
pre-commit 2.21.0
```
```shell
brew pin pre-commit@2.21.0
```
@wrkhenddher
Copy link
Author

Uninstall:

brew unpin pre-commit@2.21.0

brew uninstall pre-commit@2.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment