aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-21 23:16:56 +0800
committerGitHub <noreply@github.com>2016-06-21 23:16:56 +0800
commit00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea (patch)
treed3f82f9f5fe5a9ccb990f66b3b2a2b4bd9aaaf1e
parent957da9803ee4d867742e0bdbb2f0ba58e7135b8c (diff)
parentb6fd6ddc996af702071bee7b8cb75976ae1bc3f3 (diff)
downloaddexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.tar
dexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.tar.gz
dexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.tar.bz2
dexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.tar.lz
dexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.tar.xz
dexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.tar.zst
dexon-solidity-00c89cdb49f3dea0d9a4eee9d494d96acdd6b8ea.zip
Merge pull request #555 from Denton-L/single-line-functions
Added a Clause in Style Guide about Single Line Function Declarations
-rw-r--r--docs/style-guide.rst11
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst
index b9f06012..99db8147 100644
--- a/docs/style-guide.rst
+++ b/docs/style-guide.rst
@@ -155,7 +155,7 @@ Whitespace in Expressions
Avoid extraneous whitespace in the following situations:
-Immediately inside parenthesis, brackets or braces.
+Immediately inside parenthesis, brackets or braces, with the exception of single-line function declarations.
Yes::
@@ -165,6 +165,10 @@ No::
spam( ham[ 1 ], Coin( { name: "ham" } ) );
+Exception::
+
+ function singleLine() { spam(); }
+
Immediately before a comma, semicolon:
Yes::
@@ -482,6 +486,11 @@ No::
}
}
+When declaring short functions with a single statement, it is permissible to do it on a single line.
+
+Permissible::
+
+ function shortFunction() { doSomething(); }
These guidelines for function declarations are intended to improve readability.
Authors should use their best judgement as this guide does not try to cover all