diff options
Diffstat (limited to 'Documentation/CodingStyle')
| -rw-r--r-- | Documentation/CodingStyle | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index b49b92edb396..a667eb1fc26e 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
| @@ -218,6 +218,18 @@ no space after the prefix increment & decrement unary operators: | |||
| 218 | 218 | ||
| 219 | and no space around the '.' and "->" structure member operators. | 219 | and no space around the '.' and "->" structure member operators. |
| 220 | 220 | ||
| 221 | Do not leave trailing whitespace at the ends of lines. Some editors with | ||
| 222 | "smart" indentation will insert whitespace at the beginning of new lines as | ||
| 223 | appropriate, so you can start typing the next line of code right away. | ||
| 224 | However, some such editors do not remove the whitespace if you end up not | ||
| 225 | putting a line of code there, such as if you leave a blank line. As a result, | ||
| 226 | you end up with lines containing trailing whitespace. | ||
| 227 | |||
| 228 | Git will warn you about patches that introduce trailing whitespace, and can | ||
| 229 | optionally strip the trailing whitespace for you; however, if applying a series | ||
| 230 | of patches, this may make later patches in the series fail by changing their | ||
| 231 | context lines. | ||
| 232 | |||
| 221 | 233 | ||
| 222 | Chapter 4: Naming | 234 | Chapter 4: Naming |
| 223 | 235 | ||
| @@ -726,6 +738,33 @@ need them. Feel free to peruse that header file to see what else is already | |||
| 726 | defined that you shouldn't reproduce in your code. | 738 | defined that you shouldn't reproduce in your code. |
| 727 | 739 | ||
| 728 | 740 | ||
| 741 | Chapter 18: Editor modelines and other cruft | ||
| 742 | |||
| 743 | Some editors can interpret configuration information embedded in source files, | ||
| 744 | indicated with special markers. For example, emacs interprets lines marked | ||
| 745 | like this: | ||
| 746 | |||
| 747 | -*- mode: c -*- | ||
| 748 | |||
| 749 | Or like this: | ||
| 750 | |||
| 751 | /* | ||
| 752 | Local Variables: | ||
| 753 | compile-command: "gcc -DMAGIC_DEBUG_FLAG foo.c" | ||
| 754 | End: | ||
| 755 | */ | ||
| 756 | |||
| 757 | Vim interprets markers that look like this: | ||
| 758 | |||
| 759 | /* vim:set sw=8 noet */ | ||
| 760 | |||
| 761 | Do not include any of these in source files. People have their own personal | ||
| 762 | editor configurations, and your source files should not override them. This | ||
| 763 | includes markers for indentation and mode configuration. People may use their | ||
| 764 | own custom mode, or may have some other magic method for making indentation | ||
| 765 | work correctly. | ||
| 766 | |||
| 767 | |||
| 729 | 768 | ||
| 730 | Appendix I: References | 769 | Appendix I: References |
| 731 | 770 | ||
