WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
232 stars 180 forks source link

Add instructions on pre-commit setup #3475

Open obulat opened 8 months ago

obulat commented 8 months ago

Problem

Recently, when setting up the local dev environment with @firatbezir, we found that the setup guide does not mention pre-commit. And without setting up pre-commit, contributors cannot commit or push anything (without the --no-verify flag).

Description

Add the instructions for setting up pre-commit to the general setup documentation.

@dhruvkb, what is the best way of setting it up? Running just precommit?

Alternatives

Additional context

dhruvkb commented 8 months ago

Yes @obulat, just precommit should download the .pyz package and install the Git hooks. Some of our hooks require Docker and will fail unless they find it so in a way that's a prerequisite to this or we're back to --no-verify.

And without setting up pre-commit, contributors cannot commit or push anything

This cannot be right. Unless you set up the hooks (which just precommit does), git should allow you to commit and push anything.

dhruvkb commented 8 months ago

This is a fresh clone without just precommit. One is free to commit any change when the hooks have not been installed, see no checks ran for step 4.

Screenshot 2023-12-07 at 8 29 13 AM