xref: /libevent-2.1.12/CONTRIBUTING.md (revision a22d2033)
1*a22d2033SAzat Khuzhin# Contributing to the libevent
2*a22d2033SAzat Khuzhin
3*a22d2033SAzat Khuzhin## Coding style
4*a22d2033SAzat Khuzhin
5*a22d2033SAzat KhuzhinFirst and most generic rule: **just look around**.
6*a22d2033SAzat Khuzhin
7*a22d2033SAzat KhuzhinBut, we have a script for checking patches/files/git-refs:
8*a22d2033SAzat Khuzhin```shell
9*a22d2033SAzat Khuzhin# Chech HEAD git ref
10*a22d2033SAzat Khuzhin./checkpatch.sh -r
11*a22d2033SAzat Khuzhin./checkpatch.sh -r HEAD
12*a22d2033SAzat Khuzhin
13*a22d2033SAzat Khuzhin# Check patch
14*a22d2033SAzat Khuzhingit format-patch --stdout -1 | ./checkpatch.sh -p
15*a22d2033SAzat Khuzhingit show -1 | ./checkpatch.sh -p
16*a22d2033SAzat Khuzhin
17*a22d2033SAzat Khuzhin# Or via regular files
18*a22d2033SAzat Khuzhingit format-patch --stdout -2
19*a22d2033SAzat Khuzhin./checkpatch.sh *.patch
20*a22d2033SAzat Khuzhin
21*a22d2033SAzat Khuzhin# Over a file
22*a22d2033SAzat Khuzhin./checkpatch.sh -d event.c
23*a22d2033SAzat Khuzhin./checkpatch.sh -d < event.c
24*a22d2033SAzat Khuzhin
25*a22d2033SAzat Khuzhin# And print the whole file not only summary
26*a22d2033SAzat Khuzhin./checkpatch.sh -f event.c
27*a22d2033SAzat Khuzhin./checkpatch.sh -f < event.c
28*a22d2033SAzat Khuzhin
29*a22d2033SAzat Khuzhin# See
30*a22d2033SAzat Khuzhin./checkpatch.sh -h
31*a22d2033SAzat Khuzhin```
32*a22d2033SAzat Khuzhin
33*a22d2033SAzat Khuzhin## Testing
34*a22d2033SAzat Khuzhin- Write new unit test in `test/regress_{MORE_SUITABLE_FOR_YOU}.c`
35*a22d2033SAzat Khuzhin- `make verify`
36