diff options
author | chriseth <chris@ethereum.org> | 2018-02-23 05:41:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-23 05:41:29 +0800 |
commit | 97d1c70491c027051feac065c827b223ce6acf11 (patch) | |
tree | 7b917340d3ddd4d81194852d6f1dd4b707da3f6f /docs | |
parent | 260eb7ab1068a6e55af210fbc45ecabde78ce41c (diff) | |
parent | 2ac49b3c2d10eb43deb716cdf75ae48cd64840f8 (diff) | |
download | dexon-solidity-97d1c70491c027051feac065c827b223ce6acf11.tar.gz dexon-solidity-97d1c70491c027051feac065c827b223ce6acf11.tar.zst dexon-solidity-97d1c70491c027051feac065c827b223ce6acf11.zip |
Merge pull request #3575 from OTTTO/develop
Recommend to explicitly label the visibility of functions.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/style-guide.rst | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst index 43671060..ade37d0b 100644 --- a/docs/style-guide.rst +++ b/docs/style-guide.rst @@ -494,7 +494,7 @@ function body to be kept on the same line as the function declaration. The closing brace should be at the same indentation level as the function declaration. -The opening brace should be preceeded by a single space. +The opening brace should be preceded by a single space. Yes:: @@ -524,7 +524,21 @@ No:: function increment(uint x) public pure returns (uint) { return x + 1;} -The visibility modifiers for a function should come before any custom +You should explicitly label the visibility of all functions, including constructors. + +Yes:: + + function explicitlyPublic(uint val) public { + doSomething(); + } + +No:: + + function implicitlyPublic(uint val) { + doSomething(); + } + +The visibility modifier for a function should come before any custom modifiers. Yes:: |