diff options
author | Björn Esser <besser82@fedoraproject.org> | 2020-04-10 13:25:41 +0200 |
---|---|---|
committer | Björn Esser <besser82@fedoraproject.org> | 2020-04-11 09:40:57 +0200 |
commit | 37355cf0e6dd2f299c1e1ded88c4f4e46f080ead (patch) | |
tree | 96c85a08f13f80d265380e6a756756513edd1ac1 /STYLE.txt | |
parent | 270dc2f999b0669a8836dbca1a0900f5efe09686 (diff) | |
download | json-c-37355cf0e6dd2f299c1e1ded88c4f4e46f080ead.tar.gz |
Fix line terminators to be UNIX.
Diffstat (limited to 'STYLE.txt')
-rw-r--r-- | STYLE.txt | 64 |
1 files changed, 32 insertions, 32 deletions
@@ -1,32 +1,32 @@ -In general:
-For minor changes to a function, copy the existing formatting.
-When changing the style, commit that separately from other changes.
-For new code and major changes to a function, switch to the official json-c style.
-
-Official json-c style:
-
-Aim for readability, not strict conformance to fixed style rules.
-Formatting is tab based; previous attempts at proper alignment with
-spaces for continuation lines have been abandoned in favor of the
-convenience of using clang-format.
-Refer to the .clang-format file for details, and run the tool before commit:
-
- clang-format -i somefile.c foo.h
-
-For sections of code that would be significantly negatively impacted, surround
-them with magic comments to disable formatting:
-
- /* clang-format off */
- ...code...
- /* clang-format on */
-
-
-Naming:
-Words within function and variable names are separated with underscores. Avoid camel case.
-Prefer longer, more descriptive names, but not excessively so. No single letter variable names.
-
-Other:
-Variables should be defined for the smallest scope needed.
-Functions should be defined static when possible.
-When possible, avoid exposing internals in the public API.
-
+In general: +For minor changes to a function, copy the existing formatting. +When changing the style, commit that separately from other changes. +For new code and major changes to a function, switch to the official json-c style. + +Official json-c style: + +Aim for readability, not strict conformance to fixed style rules. +Formatting is tab based; previous attempts at proper alignment with +spaces for continuation lines have been abandoned in favor of the +convenience of using clang-format. +Refer to the .clang-format file for details, and run the tool before commit: + + clang-format -i somefile.c foo.h + +For sections of code that would be significantly negatively impacted, surround +them with magic comments to disable formatting: + + /* clang-format off */ + ...code... + /* clang-format on */ + + +Naming: +Words within function and variable names are separated with underscores. Avoid camel case. +Prefer longer, more descriptive names, but not excessively so. No single letter variable names. + +Other: +Variables should be defined for the smallest scope needed. +Functions should be defined static when possible. +When possible, avoid exposing internals in the public API. + |