diff options
Diffstat (limited to 'docs/style-guide.rst')
-rw-r--r-- | docs/style-guide.rst | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst index c36efe2c..bc32f891 100644 --- a/docs/style-guide.rst +++ b/docs/style-guide.rst @@ -25,7 +25,7 @@ solidity code. The goal of this guide is *consistency*. A quote from python's captures this concept well. A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is most important. - But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask! + But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask! *********** @@ -155,19 +155,27 @@ Whitespace in Expressions Avoid extraneous whitespace in the following situations: -* Immediately inside parenthesis, brackets or braces. +Immediately inside parenthesis, brackets or braces. -Yes: `spam(ham[1], Coin({name: "ham"}));` +Yes:: + + spam(ham[1], Coin({name: "ham"})); + +No:: -No: `spam( ham[ 1 ], Coin( { name: "ham" } ) );` + spam( ham[ 1 ], Coin( { name: "ham" } ) );` -* Immediately before a comma, semicolon: +Immediately before a comma, semicolon: -Yes: `function spam(uint i, Coin coin);` +Yes:: + + function spam(uint i, Coin coin); + +No:: -No: `function spam(uint i , Coin coin) ;` + function spam(uint i , Coin coin) ; -* More than one space around an assignment or other operator to align with +More than one space around an assignment or other operator to align with another: Yes:: |