diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-15 09:05:00 +0200 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-15 09:05:00 +0200 |
commit | 990e48b7119fe547f93a6283db78420dfd30d5bc (patch) | |
tree | bd14b08aeeeb8a240abf64772489fd6352539dc7 | |
parent | 9a051790ad6089860ec16d82da6004fb89bbe8a7 (diff) | |
download | monitoring-plugins-990e48b7119fe547f93a6283db78420dfd30d5bc.tar.gz |
Adapt the hints to coding style in the CODING file
-rw-r--r-- | CODING | 35 |
1 files changed, 11 insertions, 24 deletions
@@ -7,33 +7,20 @@ readability in a wide range of environments. | |||
7 | 7 | ||
8 | 1. C Language Programming | 8 | 1. C Language Programming |
9 | 9 | ||
10 | All code should comply with the requirements of the Free Software | 10 | All code should comply with most of the requirements of the Free Software |
11 | Foundation Coding standards (which are currently available at | 11 | Foundation Coding standards (which are currently available at |
12 | http://www.gnu.org/prep/standards_toc.html). We also follow most of | 12 | https://www.gnu.org/prep/standards/standards.html ). |
13 | the FSF guidelines. Developers may suggest deviations from the FSF | 13 | We also follow most of the FSF guidelines, with the huge and explicit |
14 | exception of the style guidelines. | ||
15 | Developers may suggest deviations from the FSF | ||
14 | style recommendations, which will be considered by open discussion on | 16 | style recommendations, which will be considered by open discussion on |
15 | the Monitoring Plugins devel mailing list. Any such deviations will | 17 | the Monitoring Plugins devel mailing list or the Github Pull Request. |
16 | apply to the entire code base to ensure consistency. | 18 | Any such deviations should be |
17 | 19 | applied to the entire code base to ensure consistency. | |
18 | Currently, the exceptions to FSF recommendations are roughly equivalent | ||
19 | to GNU indent with invoked as 'indent -ts 2 -br'. Specifically, the | ||
20 | exceptions are as follows: | ||
21 | |||
22 | a) leading white space for a statement should be formatted as tabs, | ||
23 | with one tab for each code indentation level. | ||
24 | |||
25 | b) in statement continuation lines, format whitespace up to the column | ||
26 | starting the statement as tabs, format the rest as spaces (this | ||
27 | results in code that is legible regardless of tab-width setting). | ||
28 | |||
29 | c) with the exception of the above, tabs should generally be avoided | ||
30 | |||
31 | d) when tab width is 2 spaces, line-length should not exceed 80 | ||
32 | characters | ||
33 | |||
34 | e) The opening brace of an if or while block is on the same line as | ||
35 | the end of the conditional expression (the '-br' option). | ||
36 | 20 | ||
21 | The style guideline is the following: | ||
22 | Whatever clang-format does with the configuration file available (.clang-format) | ||
23 | Apart from that, code should naturally be readable and easy to understand. | ||
37 | 24 | ||
38 | 2. Perl Language Programming | 25 | 2. Perl Language Programming |
39 | 26 | ||