Skip to content

Commit

Permalink
rfc7: break long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed May 27, 2015
1 parent 69ecfac commit 7aee8d7
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions spec_7.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ ifdef::env-github[:outfilesuffix: .adoc]
7/Flux Coding Style Guide
=========================

This specification presents the recommended standards when contributing code to the Flux code base.
This specification presents the recommended standards when contributing
code to the Flux code base.

* Name: github.com/flux-framework/rfc/spec_7.adoc
* Editor: Don Lipari <[email protected]>
Expand All @@ -22,30 +23,37 @@ be interpreted as described in http://tools.ietf.org/html/rfc2119[RFC 2119].
== Goals

* Encourage a uniform coding style in flux-framework projects
* Provide a document to reference when providing style feedback in project pull requests
* Provide a document to reference when providing style feedback in
project pull requests

== C Coding Style Recommendations

In general, Flux follows the "Kernighan & Ritchie coding style" with the following exceptions or examples:
In general, Flux follows the "Kernighan & Ritchie coding style" with the
following exceptions or examples:

1. Indenting SHOULD be with spaces, and not tabs.
2. One level of indentation SHOULD be 4 spaces.
3. One space SHOULD separate function names and the opening parenthesis (enhances readability).
4. There SHOULD be no trailing spaces (or tabs) after the last non-space character in a line.
3. One space SHOULD separate function names and the opening parenthesis
(enhances readability).
4. There SHOULD be no trailing spaces (or tabs) after the last non-space
character in a line.
5. Lines SHOULD be limited to 80 characters.
6. Comments SHOULD be indented to the depth of the code they are describing.
7. The return type SHOULD be on the same line as the function declaration.
8. One space SHOULD separate the star and type in pointer declarations. Example:
8. One space SHOULD separate the star and type in pointer declarations.
Example:
----
int *ptr;
----

Tools That Modify Code to Conform to C Coding Style
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"indent -kr" will bring you most of the way towards conforming to the Flux coding style.
"indent -kr" will bring you most of the way towards conforming to the Flux
coding style.

Those using vi will automatically follow some of the Flux style based on the presence of the following at the end of each file:
Those using vi will automatically follow some of the Flux style based on
the presence of the following at the end of each file:

----
/*
Expand All @@ -59,7 +67,8 @@ In vim, use the following to highlight whitespace errors:
let c_space_errors = 1
----

In emacs, add this to your custom-set-variables defs to highlight whitespace errors:
In emacs, add this to your custom-set-variables defs to highlight
whitespace errors:

----
'(show-trailing-whitespace t)
Expand Down

0 comments on commit 7aee8d7

Please sign in to comment.