Skip to content

Add doc related to setting up pre-commit hook #736

Closed
@thelovekesh

Description

Currently, we are using lint-staged to run linter on staged files but we are lacking documentation to add lint-staged on the pre-commit hook.
We can add a code snippet in the wiki that can help contributors/devs to set up the pre-commit hook something like this:

echo "set -e; composer run-script pre-commit" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

One more thought came up to my mind. What if the user is on Windows OS?
Should we add husky to overcome this issue? We can add a pre-commit hook using husky on the prepare script. So when the user runs npm install, husky will add a pre-commit hook.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions