File: CONTRIBUTING.md

package info (click to toggle)
tlog 14-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,172 kB
  • sloc: ansic: 15,890; python: 1,185; makefile: 526; sh: 114
file content (126 lines) | stat: -rw-r--r-- 3,512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Contributing to Tlog
The Tlog project welcomes new contributors. This document will guide you
through the process.

## Pull Requests
We actively welcome your pull requests. There are a few guidelines that
we need contributors to follow so that we can keep the codebase consistent
and clean.

* Fork the main repository and clone it to your local machine.
* Create a topic branch from master. Please avoid working directly on
the ```master``` branch.
* Make commits of logical units, and make sure to follow the
coding style guidelines.
* Submit the pull request (PR) on Github.

## Issues
We use GitHub [issues tracker](https://github.com/Scribery/tlog/issues)
to track bugs.
Please ensure your description is clear and has sufficient instructions;
so we are able to reproduce the issue.

## Coding Style guidelines

* Use four spaces for indentation, please don't use tabs except where
required, such as in Makefiles.

* Lines should be at most 78 chars.

* Please don't leave trailing whitespace at the ends of lines.

* Braces open on the same line as the `for`/`while`/`if`/`else`
/`switch`/etc. Closing braces are put on a line of their own, except
in the `else` of an `if` statement or before a `while` of a `do`-`while`
statement. Always use braces for `if` and `while`.

```c
if (a == b) {
    ...
}

if (a == b) {
    ...
} else if (a > b) {
    ...
}

if (a == b) {
    do_something();
} else {
    do_something_else();
}

do {
    do_something();
} while (cond);

while (cond) {
    do_something();   
}

switch (expression) {
case constant-expression:
    ...
case constant-expression:
    ...
default:
    ...
}

```

* For function, `static` and return type are put on the same line.
Function's name is put on a line of its own.

```c
static tlog_grc
tlog_play_run(struct tlog_errs **perrs, int *psignal)
{
              ...
}
```

* For regular comments, use C style (`/*` `*/`) comments, even for one-line.

* For doc-comments (Doxygen comments), use the `/**` `*/` style featured.

* For wrapping (`\`) of macro, be sure to follow:

```c
#define CMP_BOOL(_name) \
    do {                                                        \
        if (_name != t._name##_out) {                           \
            FAIL(#_name " %s != %s",                            \
                 BOOL_STR(_name), BOOL_STR(t._name##_out));     \
        }                                                       \
    } while (0)
```

## Directories
Tlog source is organized as follows.

```
.                        <- Top-level build and documentation files.
├── doc                  <- Documentation.
├── include              <- C headers.
│   ├── tlog             <- Tlog library headers.
│   ├── tltest           <- Tlog test library headers.
├── lib                  <- C library sources.
│   ├── tlog             <- Tlog library sources.
│   ├── tltest           <- Tlog test library sources.
├── src                  <- Program sources.
│   ├── tlog             <- Tlog sources.
│   ├── tltest           <- Tlog test sources.
├── m4                   <- M4 macros.
│   ├── autotools        <- Autotools macros.
│   ├── tlog             <- Tlog macros
└── man                  <- Manpages.
```

Follow instructions in [README](README.md) for how to compile and run
test code.

## License
By contributing to Tlog, you agree that your contributions will be licensed
under the [GNU GPL v2 or later](COPYING).