mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Reccomend to explicitly label the visibility of functions.
This commit is contained in:
parent
187e50b14c
commit
2ac49b3c2d
@ -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
|
The closing brace should be at the same indentation level as the function
|
||||||
declaration.
|
declaration.
|
||||||
|
|
||||||
The opening brace should be preceeded by a single space.
|
The opening brace should be preceded by a single space.
|
||||||
|
|
||||||
Yes::
|
Yes::
|
||||||
|
|
||||||
@ -524,7 +524,21 @@ No::
|
|||||||
function increment(uint x) public pure returns (uint) {
|
function increment(uint x) public pure returns (uint) {
|
||||||
return x + 1;}
|
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.
|
modifiers.
|
||||||
|
|
||||||
Yes::
|
Yes::
|
||||||
|
Loading…
Reference in New Issue
Block a user