Skip to content

Commit

Permalink
CodingStyle: add information about trailing whitespace
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Triplett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Josh Triplett authored and Linus Torvalds committed Jul 16, 2007
1 parent 9e8c427 commit a923fd6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ no space after the prefix increment & decrement unary operators:

and no space around the '.' and "->" structure member operators.

Do not leave trailing whitespace at the ends of lines. Some editors with
"smart" indentation will insert whitespace at the beginning of new lines as
appropriate, so you can start typing the next line of code right away.
However, some such editors do not remove the whitespace if you end up not
putting a line of code there, such as if you leave a blank line. As a result,
you end up with lines containing trailing whitespace.

Git will warn you about patches that introduce trailing whitespace, and can
optionally strip the trailing whitespace for you; however, if applying a series
of patches, this may make later patches in the series fail by changing their
context lines.


Chapter 4: Naming

Expand Down

0 comments on commit a923fd6

Please sign in to comment.