Skip to content

chore(Makefile): add setup-pre-commit target to init git hook (backport #2123)#2185

Merged
melekes merged 1 commit intov1.xfrom
mergify/bp/v1.x/pr-2123
Jan 29, 2024
Merged

chore(Makefile): add setup-pre-commit target to init git hook (backport #2123)#2185
melekes merged 1 commit intov1.xfrom
mergify/bp/v1.x/pr-2123

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jan 29, 2024

This is an automatic backport of pull request #2123 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

### Description

To be honest, we often forget to run `make lint` or check the result of
`make lint` before we push the commits

This pr adds a git `pre-commit` hook for linting new changes code, this
will prevent contributors from pushing their commits without linting,
and reduce the times of re-run ci.

### How to use

After you clone the repository, just simply run `make setup-pre-commit`

![image](https://github.com/cometbft/cometbft/assets/150114626/3bb46db5-418c-4729-84cf-7d929f171ec1)

### Screenshots

![image](https://github.com/cometbft/cometbft/assets/150114626/8b0ad2e9-2e93-43a6-9973-42227112b560)

(cherry picked from commit 02a43b0)
@mergify mergify bot requested a review from a team as a code owner January 29, 2024 12:27
@mergify mergify bot requested a review from a team January 29, 2024 12:27
@melekes melekes merged commit f03c475 into v1.x Jan 29, 2024
@melekes melekes deleted the mergify/bp/v1.x/pr-2123 branch January 29, 2024 12:34
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.

2 participants