Changes between Version 7 and Version 8 of RFC4
- Timestamp:
- Mar 23, 2017, 9:51:10 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RFC4
v7 v8 18 18 There is a need to decide on format of GEOS source code and apply such globally consistent format to GEOS C/C++ codebase. 19 19 20 A uniform, codebase-wide formatting style makes reading and comprehending existing code easier, writing code focused on important aspects of new developments and more pleas ent, removes burden during a patch or pull request code reviews and prevents [http://wiki.c2.com/?WhereDoTheBracesGo bikeshedding religious arguments]. Even in small projects, contributing developers discover the problems of working without an agreed upon code format.20 A uniform, codebase-wide formatting style makes reading and comprehending existing code easier, writing code focused on important aspects of new developments and more pleasant, removes burden during a patch or pull request code reviews and prevents [http://wiki.c2.com/?WhereDoTheBracesGo bikeshedding religious arguments]. Even in small projects, contributing developers discover the problems of working without an agreed upon code format. 21 21 22 22 The utility of such guidelines has been proven by many open source software projects. 23 24 "A mature engineers know that a standard is more important than which standard." ~[MongoDB]25 23 26 24 The scope of the proposal is specifically limited to formatting style guidelines. It is not an intention to develop a general coding guide covering other aspects of writing software like naming, etc. … … 44 42 == Code Formatting Rules == 45 43 46 What code formatting rules to use? 44 What code formatting rules to use? 45 46 ''"A mature engineers know that a standard is more important than which standard."'' ~[MongoDB] 47 47 48 48 `clang-format` offers several defaults (eg. LLVM, Mozilla, Linux, Google C++ Style). 49 49 50 The proposal recommends to use one of the base styles, if necessary, fine-tun ning as an easier way to get started than deciding on each option one by one.50 The proposal recommends to use one of the base styles, if necessary, fine-tuning as an easier way to get started than deciding on each option one by one. 51 51 52 52 The reasons are two-fold: … … 56 56 === `.clang-format` === 57 57 58 Proposed below is complete set of settings sufficient to maintain the clean code formatting style. It remains open for refinements. 58 Proposed below is complete set of settings sufficient to maintain the clean code formatting style. 59 60 NOTE: It remains open for refinements. 59 61 60 62 {{{ … … 87 89 === `.editorconfig` === 88 90 89 [http://editorconfig.org/ EditorConfig] is currently in use and `.editorconfig` file is provi ed to automatically tell popular code editors about the basic style settings91 [http://editorconfig.org/ EditorConfig] is currently in use and `.editorconfig` file is provided to automatically tell popular code editors about the basic style settings 90 92 like indentation, whitespaces and end-of-line markers for distinguished types of plain text files. 91 93 … … 102 104 Partial application of the code formatting rules would create more work without delivering the full benefit [MongoDB] leading to codebase with different styles mixed. 103 105 106 ==== Implementation ==== 107 108 Branches to run the big reformat in are: 109 110 * `trunk` 111 * `branches/3.6` 112 * `branches/3.5` 113 * `branches/3.4` 114 104 115 == After Big Reformat == 105 116 … … 111 122 * There is downside of history clutter in repository, but this proposal states that a codebase with different styles across is even worse. 112 123 113 == Conclusion == 124 ''"After all, every moment of time wasted on code formatting or discussion thereof is eliminated."'' ~[MongoDB] 114 125 115 "After all, every moment of time wasted on code formatting or discussion thereof is eliminated." ~[MongoDB] 126 ==== Implementation ==== 127 128 Set up Travis CI "style safety valve" build dedicated to run clang-format lint based on the approach used in `clang_format.py` script by MongoDB. 116 129 117 130 == References ==