solidity/docs/contributing.rst

103 lines
4.7 KiB
ReStructuredText
Raw Normal View History

2016-08-29 17:24:28 +00:00
############
Contributing
############
Help is always appreciated!
2017-06-12 15:18:55 +00:00
To get started, you can try :ref:`building-from-source` in order to familiarize
yourself with the components of Solidity and the build process. Also, it may be
useful to become well-versed at writing smart-contracts in Solidity.
2016-08-29 17:24:28 +00:00
In particular, we need help in the following areas:
* Improving the documentation
* Responding to questions from other users on `StackExchange
<https://ethereum.stackexchange.com>`_ and the `Solidity Gitter
2016-08-29 17:24:28 +00:00
<https://gitter.im/ethereum/solidity>`_
* Fixing and responding to `Solidity's GitHub issues
2016-10-13 13:10:12 +00:00
<https://github.com/ethereum/solidity/issues>`_, especially those tagged as
`up-for-grabs <https://github.com/ethereum/solidity/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs>`_ which are
meant as introductory issues for external contributors.
2016-08-29 17:24:28 +00:00
How to Report Issues
====================
To report an issue, please use the
`GitHub issues tracker <https://github.com/ethereum/solidity/issues>`_. When
reporting issues, please mention the following details:
* Which version of Solidity you are using
2016-09-05 14:29:08 +00:00
* What was the source code (if applicable)
2016-08-29 17:24:28 +00:00
* Which platform are you running on
* How to reproduce the issue
* What was the result of the issue
* What the expected behaviour is
2016-09-05 14:29:08 +00:00
Reducing the source code that caused the issue to a bare minimum is always
very helpful and sometimes even clarifies a misunderstanding.
2016-08-29 17:24:28 +00:00
Workflow for Pull Requests
==========================
In order to contribute, please fork off of the ``develop`` branch and make your
2016-09-05 14:29:08 +00:00
changes there. Your commit messages should detail *why* you made your change
in addition to *what* you did (unless it is a tiny change).
2016-08-29 17:24:28 +00:00
If you need to pull in any changes from ``develop`` after making your fork (for
example, to resolve potential merge conflicts), please avoid using ``git merge``
and instead, ``git rebase`` your branch.
Additionally, if you are writing a new feature, please ensure you write appropriate
2016-08-29 17:24:28 +00:00
Boost test cases and place them under ``test/``.
However, if you are making a larger change, please consult with the Gitter
channel, first.
2016-08-29 17:24:28 +00:00
Finally, please make sure you respect the `coding standards
<https://raw.githubusercontent.com/ethereum/cpp-ethereum/develop/CodingStandards.txt>`_
for this project. Also, even though we do CI testing, please test your code and
ensure that it builds locally before submitting a pull request.
Thank you for your help!
2016-11-28 13:13:42 +00:00
Running the compiler tests
==========================
Solidity includes different types of tests. They are included in the application
2017-09-28 08:28:41 +00:00
called ``soltest``. Some of them require the ``cpp-ethereum`` client in testing mode,
some others require ``libz3`` to be installed.
2016-11-28 13:13:42 +00:00
2017-09-28 08:28:41 +00:00
To disable the z3 tests, use ``./build/test/soltest -- --no-smt`` and
to run a subset of the tests that do not require ``cpp-ethereum``, use ``./build/test/soltest -- --no-ipc``.
2016-11-28 13:13:42 +00:00
For all other tests, you need to install `cpp-ethereum <https://github.com/ethereum/cpp-ethereum/releases/download/solidityTester/eth>`_ and run it in testing mode: ``eth --test -d /tmp/testeth``.
Then you run the actual tests: ``./build/test/soltest -- --ipcpath /tmp/testeth/geth.ipc``.
2016-11-28 13:13:42 +00:00
To run a subset of tests, filters can be used:
``soltest -t TestSuite/TestName -- --ipcpath /tmp/testeth/geth.ipc``, where ``TestName`` can be a wildcard ``*``.
Alternatively, there is a testing script at ``scripts/test.sh`` which executes all tests and runs
``cpp-ethereum`` automatically if it is in the path (but does not download it).
Travis CI even runs some additional tests (including ``solc-js`` and testing third party Solidity frameworks) that require compiling the Emscripten target.
2017-06-21 19:46:42 +00:00
Whiskers
========
2017-07-05 04:46:07 +00:00
*Whiskers* is a templating system similar to `Mustache <https://mustache.github.io>`_. It is used by the
2017-06-21 19:46:42 +00:00
compiler in various places to aid readability, and thus maintainability and verifiability, of the code.
2017-07-05 04:46:07 +00:00
The syntax comes with a substantial difference to Mustache: the template markers ``{{`` and ``}}`` are
2017-06-21 19:46:42 +00:00
replaced by ``<`` and ``>`` in order to aid parsing and avoid conflicts with :ref:`inline-assembly`
(The symbols ``<`` and ``>`` are invalid in inline assembly, while ``{`` and ``}`` are used to delimit blocks).
Another limitation is that lists are only resolved one depth and they will not recurse. This may change in the future.
A rough specification is the following:
Any occurrence of ``<name>`` is replaced by the string-value of the supplied variable ``name`` without any
escaping and without iterated replacements. An area can be delimited by ``<#name>...</name>``. It is replaced
by as many concatenations of its contents as there were sets of variables supplied to the template system,
2017-07-05 04:46:07 +00:00
each time replacing any ``<inner>`` items by their respective value. Top-level variables can also be used
inside such areas.