Skip to content

Commit 97623e4

Browse files
committed
readme: improve user guide
1 parent 5831eed commit 97623e4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@ User Guide
164164
-
165165

166166
Once you have installed the library, you can start writing you first hook.
167-
You can start by taking one of the example as a template.
168-
Your hook's check function will get called with a log and a revdata object:
167+
It is easy to just get started by copy-pasting one of the examples.
168+
A hook should is a python class that derives from the base class `basehook`.
169+
170+
The hook's `check(self, log, revdata)` instance function will get called with a `log` and a `revdata` object:
169171
- The `check` function should return True if the hook passes and False otherwise.
170172
- The `log` object can be used to send feedback to the user, for example, if your hook rejects a commit, you can explain what justifies the rejection. You can use `log.write(str)` as shown in the examples
171173
- The `revdata` object allows you to get all the information that you need about the state of the repo.
@@ -196,7 +198,7 @@ class gitprereceiveinputparser(gitreceiveinputparser)
196198

197199
Contributing
198200
-
199-
Before sending a Pull-Request please run the tests:
201+
Before sending a Pull Request please run the tests:
200202

201203
- To run the unit tests, simply call `python hooktests.py`, let's keep the unit test suite running under 1s
202204
You have to install mock to run the tests: `sudo pip install mock==1.0.0`

0 commit comments

Comments
 (0)