Tomoko Uchida created LUCENE-10028:
--------------------------------------

             Summary: Optionally allow to enable git pre-commit hook for 
precommit
                 Key: LUCENE-10028
                 URL: https://issues.apache.org/jira/browse/LUCENE-10028
             Project: Lucene - Core
          Issue Type: Task
          Components: general/build
            Reporter: Tomoko Uchida


With [githooks|https://git-scm.com/docs/githooks], one can automatically 
perform {{arbitrary }}checks (e.g. "precommit") when before performing "git 
commit".

I found the precommit check is now pretty fast on main branch, it might make 
sense for developers who want to run it in an automated manner (to prevent 
premature commits ore push).

*Implementation*

Hooks are just plain shell scripts that are placed in .git/hooks, so we can 
provide a simple executable "pre-commit" script that runs "gradlew precommit" 
and a gradle Copy task to copy it under local .git/hooks dir.

*Usage*

Install pre-commit hook (opt-in)
{code:java}
./gradlew precommitHook
{code}
After installing, precommit will be automatically performed before every commit.
{code:java}
git commit -m "commit attempt that doesn't pass spotless check"
......
> Task :lucene:luke:spotlessJavaCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lucene:luke:spotlessJavaCheck'.
> The following files had format violations:
......
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to