Convert style guide to markdown
This commit is contained in:
parent
362dfa3380
commit
ebc32aadad
@ -1,16 +1,15 @@
|
|||||||
|
# OpenRC Style Guide
|
||||||
|
|
||||||
This is the openrc style manual. It governs the coding style of all code
|
This is the openrc style manual. It governs the coding style of all code
|
||||||
in this repository. Follow it. Contact openrc@gentoo.org for any questions
|
in this repository. Follow it. Contact openrc@gentoo.org for any questions
|
||||||
or fixes you might notice.
|
or fixes you might notice.
|
||||||
|
|
||||||
##########
|
## C CODE
|
||||||
# C CODE #
|
|
||||||
##########
|
|
||||||
|
|
||||||
The BSD Kernel Normal Form (KNF) style is used:
|
The BSD Kernel Normal Form (KNF) style is used [1]. Basically, it is like
|
||||||
http://en.wikipedia.org/wiki/Indent_style#BSD_KNF_style
|
K&R/LKML, but wrapped lines that are indented use 4 spaces. Here are the
|
||||||
Basically, it's like K&R/LKML, but wrapped lines that are indented use 4 spaces.
|
highlights.
|
||||||
|
|
||||||
Highlights:
|
|
||||||
- no trailing whitespace
|
- no trailing whitespace
|
||||||
- indented code use tabs (not line wrapped)
|
- indented code use tabs (not line wrapped)
|
||||||
- cuddle the braces (except for functions)
|
- cuddle the braces (except for functions)
|
||||||
@ -18,6 +17,7 @@ Highlights:
|
|||||||
- no space between function and paren
|
- no space between function and paren
|
||||||
- pointer asterisk cuddles the variable, not the type
|
- pointer asterisk cuddles the variable, not the type
|
||||||
|
|
||||||
|
```
|
||||||
void foo(int c)
|
void foo(int c)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -32,16 +32,15 @@ void foo(int c)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
##################
|
## COMMIT MESSAGES
|
||||||
# COMMIT MESSAGES #
|
|
||||||
##################
|
|
||||||
|
|
||||||
The following is an example of a correctly formatted git commit message
|
The following is an example of a correctly formatted git commit message
|
||||||
for this repository. Most of this information came from this blog post
|
for this repository. Most of this information came from this blog post
|
||||||
[1], so I would like to thank the author.
|
[2], so I would like to thank the author.
|
||||||
|
|
||||||
### cut here ###
|
```
|
||||||
Capitalized, short (50 chars or less) summary
|
Capitalized, short (50 chars or less) summary
|
||||||
|
|
||||||
More detailed explanatory text, if necessary. Wrap it to about 72
|
More detailed explanatory text, if necessary. Wrap it to about 72
|
||||||
@ -67,7 +66,7 @@ Further paragraphs come after blank lines.
|
|||||||
Reported-by: User Name <email>
|
Reported-by: User Name <email>
|
||||||
X-[Distro]-Bug: BugID
|
X-[Distro]-Bug: BugID
|
||||||
X-[Distro]-Bug-URL: URL for the bug (on the distribution's web site typically)
|
X-[Distro]-Bug-URL: URL for the bug (on the distribution's web site typically)
|
||||||
### cut here ###
|
```
|
||||||
|
|
||||||
If you did not write the code and the patch does not include authorship
|
If you did not write the code and the patch does not include authorship
|
||||||
information in a format git can use, please use the --author option of the
|
information in a format git can use, please use the --author option of the
|
||||||
@ -81,5 +80,5 @@ different from the author and committer.
|
|||||||
*BSD. Also, [Distro] should be replaced with the name of the
|
*BSD. Also, [Distro] should be replaced with the name of the
|
||||||
distribution, e.g. X-Gentoo-Bug.
|
distribution, e.g. X-Gentoo-Bug.
|
||||||
|
|
||||||
[1] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
[1] http://en.wikipedia.org/wiki/Indent_style#BSD_KNF_style
|
||||||
|
[2] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
Loading…
Reference in New Issue
Block a user