mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
docs: fix formatting errors and style inconsistencies
This commit is contained in:
@@ -24,8 +24,11 @@ solidity code. The goal of this guide is *consistency*. A quote from python's
|
||||
`pep8 <https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds>`_
|
||||
captures this concept well.
|
||||
|
||||
.. note::
|
||||
|
||||
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 judgement. 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 judgement. Look at other examples and decide what looks best. And don't hesitate to ask!
|
||||
|
||||
|
||||
***********
|
||||
@@ -383,8 +386,7 @@ No::
|
||||
|
||||
function spam(uint i , Coin coin) public ;
|
||||
|
||||
More than one space around an assignment or other operator to align with
|
||||
another:
|
||||
More than one space around an assignment or other operator to align with another:
|
||||
|
||||
Yes::
|
||||
|
||||
@@ -996,7 +998,7 @@ Contract and Library Names
|
||||
* Contract and library names should also match their filenames.
|
||||
* If a contract file includes multiple contracts and/or libraries, then the filename should match the *core contract*. This is not recommended however if it can be avoided.
|
||||
|
||||
As shown in the example below, if the contract name is `Congress` and the library name is `Owned`, then their associated filenames should be `Congress.sol` and `Owned.sol`.
|
||||
As shown in the example below, if the contract name is ``Congress`` and the library name is ``Owned``, then their associated filenames should be ``Congress.sol`` and ``Owned.sol``.
|
||||
|
||||
Yes::
|
||||
|
||||
@@ -1132,8 +1134,8 @@ Solidity contracts can have a form of comments that are the basis of the
|
||||
Ethereum Natural Language Specification Format.
|
||||
|
||||
Add comments above functions or contracts following `doxygen <http://www.doxygen.nl>`_ notation
|
||||
of one or multiple lines starting with `///` or a
|
||||
multiline comment starting with `/**` and ending with `*/`.
|
||||
of one or multiple lines starting with ``///`` or a
|
||||
multiline comment starting with ``/**`` and ending with ``*/``.
|
||||
|
||||
For example, the contract from `a simple smart contract <simple-smart-contract>`_ with the comments
|
||||
added looks like the one below::
|
||||
|
||||
Reference in New Issue
Block a user