meilisearch / documentation

Meilisearch documentation

Home Page:https://docs.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add pre-commit hooks

Strift opened this issue · comments

It often happens that PR are submitted (by me 🤡) without running the linter first.

Adding a pre-commit hook to automatically run the linter before creating a commit can help with ensure that this is done and doesn't waste reviewers time.

(It can still be possible to commit bypass this protection if needed when doing quick & dirty stuff, the CI will still run for PRs)

The docs team had this discussion a long time ago and I believe @curquiza was against running linters on actions because this might dissuade contributors from submitting PRs.

Yeah I'm not a big fan of imposed pre-commit hook. It definitely can prevent people from submitting. It prevented me in the past for example 😅
We would rather have a contribution with linting issue (we can update ourselves) rather than no contribution at all. The linting problem should be visible in the CI associated to the PR. It's already the case right?

But only my opinion, I had bad experiences with pre-commit hook when trying to contribute to other opensource repositories.

Also, I think pre-commit hook can be set up individually (so you can set it up on your side @Strift) without imposing it to everyone

You have infinitely more experience in managing public repositories, @curqui, so I'm inclined to side with you on this matter. I do empathize with @Strift, though, as I have uh occasionally forgotten to run linters.

Even if I have more experience, I don't have THE experience 😊
IMO, the most important is you also feel comfortable with your tool. So, the best world is to be able to customize pre-commit hook on your sides only, and don't impose it on contributors.

If not possible, I would go with imposing it on everyone if it really helps your day-to-day work. Your contributions are more than the external contributor's ones, and bring more impact and quality. It's important you feel comfortable with your work tools.

I think it's fine to have it in CI only for now :)