Skip to content

Latest commit

 

History

History
107 lines (70 loc) · 3.39 KB

CONTRIBUTING.md

File metadata and controls

107 lines (70 loc) · 3.39 KB

Contribution guide

Table of contents

  1. Coding style guide
  2. Documentation style guide

Coding style guide

Source code comments

Follow the NatSpec format for documentating smart contract source code. Please adhere to a few additional standards:

  • Choose /** */ over /// for multi-line NatSpec comments, to save column space
  • Omit the usage of @notice, this will be automatically picked up so it will save column space and improve readability
  • Take advantage of inheritance for docs (such as documenting the interface), if you need to specify inherited docs use @inheritdoc

Git standards

Commits

Try to specify the scope of your change via a conventional commit (eg. enhance(docs): improve some section) or specifying the scope in brackets (eg. [docs] improve some section).

Documentation style guide

Document types

Group documentation under one of the four categories:

  • Tutorials
  • Guides
  • Concepts
  • Reference

Philosophy

  • Aim for "better" instead of "perfect" -- any enhancement is a worthwhile improvement.
  • Create the minimum viable documentation.
  • Don't repeat yourself, use links to existing documentation or inherit it.
  • Generate documentation automatically from source code whenever possible.
  • Keep your comments as close as possible to the actual source code it is describing.

Standards

Tone and content

Language and grammar

Formatting, punctuation, and organization

Images

  • Use SVG files or crushed PNG images.
  • Provide alt text.

Code blocks

  • Do not use $ in shell blocks.

    Incorrect ❌:

    $ echo "this is worse for copy paste"

    Correct ✅:

    echo "this is better for copy paste"
  • Escape new lines.

    Incorrect ❌:

    echo "going to pretend that this"
    && echo "is some really long command"

    Correct ✅:

    echo "at least the command" \
    && echo "looks good when copy pastad"

References