librsync  2.0.2
CONTRIBUTING.md
1 # Contributing to librsync {#page_contributing}
2 
3 Instructions and conventions for people wanting to work on librsync. Please
4 consider these guidelines even if you're doing your own fork.
5 
6 ## Code Style
7 
8 The prefered style for code is equivalent to using GNU indent with the
9 following arguments;
10 
11 ```Shell
12 $ indent -linux -nut -i4 -ppi2 -l80 -lc80 -fc1 -fca -sob
13 ```
14 
15 The preferred style for non-docbook comments are as follows;
16 
17 ```C
18 
19  /*=
20  | A short poem that
21  | shall never ever be
22  | reformated or reindented
23  */
24 
25  /* Single line comment indented to match code indenting. */
26 
27  /* Blank line delimited paragraph multi-line comments.
28 
29  Without leading stars, or blank line comment delimiters. */
30 
31  int a; /* code line comments */
32 ```
33 
34 The preferred style for docbook comments is javadoc with autobrief as
35 follows;
36 
37 ```C
38 /** \file file.c Brief summary paragraph.
39  *
40  * With blank line paragraph delimiters and leading stars.
41  *
42  * \param foo parameter descriptions...
43  *
44  * \param bar ...in separate blank-line delimited paragraphs.
45  *
46  * Example:\code
47  * code blocks that will never be reformated.
48  * \endcode
49  *
50  * Without blank-line comment delimiters. */
51 
52  int a; /**< brief attribute description */
53  int b; /**< multiline attribute description
54  *
55  * With blank line delimited paragraphs.*/
56 ```
57 
58 There is a `make tidy` target that will use GNU indent to reformat all
59 code and non-docbook comments, doing some pre/post processing with sed
60 to handle some corner cases indent doesn't handle well.
61 
62 There is also a `make tidyc` target that will reformat all code and
63 comments with https://github.com/dbaarda/tidyc. This will also
64 correctly reformat all docbook comments, equivalent to running tidyc
65 with the following arguments;
66 
67 ```Shell
68 $ tidyc -R -C -l80
69 ```
70 
71 ## Pull requests
72 
73 Fixes or improvements in pull requests are welcome. Please:
74 
75 - [ ] Send small PRs that address one issues each.
76 
77 - [ ] Update `NEWS.md` to say what you changed.
78 
79 - [ ] Add a test as a self-contained C file in `tests/` that passes or fails,
80  and is hooked into `CMakeLists.txt`.
81 
82 - [ ] Keep the code style consistent with what's already there, especially in
83  keeping symbols with an `rs_` prefix.
84 
85 
86 ## NEWS
87 
88 [NEWS.md](NEWS.md) contains a list of user-visible changes in the library between
89 releases version. This includes changes to the way it's packaged,
90 bug fixes, portability notes, changes to the API, and so on.
91 
92 Add
93 and update items under a "Changes in X.Y.Z" heading at the top of
94 the file. Do this as you go along, so that we don't need to work
95 out what happened when it's time for a release.
96 
97 ## Tests
98 
99 Please try to update docs and tests in parallel with code changes.
100 
101 ## Releasing
102 
103 If you are making a new tarball release of librsync, follow this checklist:
104 
105 * NEWS.md - make sure the top "Changes in X.Y.Z" is correct, and the date is
106  correct.
107 
108 * `CMakeLists.txt` - version is correct.
109 
110 * `librsync.spec` - make sure version and URL are right.
111 
112 * Run `make all doc check` in a clean checkout of the release tag.
113 
114 Test results for builds of public github branches are at
115 https://travis-ci.org/librsync/librsync.