The key words MUST
, MUST NOT
, REQUIRED
, SHALL
, SHALL NOT
, SHOULD
,
SHOULD NOT
, RECOMMENDED
, MAY
, and OPTIONAL
in this document are to be
interpreted as described in RFC 2119.
These keywords SHALL
be in monospace
for ease of identification.
This repository uses pre-commit
. If you add a new filetype, you SHOULD
add
a new hook. See adding new hooks for additional info.
In the cfg/
directory are all of the pre-commit
configuration files for
various hooks.
To set up your local workspace to use pre-commit
or change any of the hook
configurations, please see the pre-commit configuration README.
If you'd like to run our Python formatter locally to pass pre-commit
checks,
you can run our Python format script.
This repository uses GitHub actions to perform assorted status checks. If you
submit a pull request but do not run pre-commit
then your pull request might
get blocked.
This repository handles pull requests (PRs) using the squash and merge method.
The Econia Labs team uses Linear for project management, such that PRs titles
start with tags of the form [ECO-WXYZ]
. All PRs MUST
include a tag, so if
you are submitting a PR as a community contributor, an Econia Labs member
SHALL
change your PR title to include an auto-generated tag for internal
tracking purposes.
Pull requests MUST
include a description written using imperative form that
"tells the repository what to do".
Pull request titles MUST
also use imperative form, with the first letter after
the tag capitalized. For example [ECO-WXYZ] Update something in the repo
.
Commit titles SHOULD
use a similar format, but without a leading tag.
Resolution of a review comment SHALL
be reserved for the reviewer who made the
comment, except for the case of suggestion acceptance, which automatically
results in the comment being marked as resolved.
- During preliminary design phases, design
SHALL
emphasize abstraction and ease of testing, with optimizations in mind, for example, to reduce borrows. - Asserts
SHALL
be wrapped in helper functions to reduce failure tests. - Inlining
SHALL
only be used for functions that pass up a reference to a borrow out of global storage.
- Incorrect comments are worse than no comments.
- Minimize maintainability dependencies.
- Prefer compact code blocks, delimited by section comments rather than whitespace.
- Titles
SHALL
useTitle Case
while headersSHALL
useSentence case
. - Comments
SHALL
start with a capital letter and end with a period.
, even if they are a single line.
- Reference links are
REQUIRED
where possible, for readability and for ease of linting. - LaTeX display equations
SHALL
be delimited via amath
fenced code block (note that you can render these locally using thegitlab
delimiter for the VS Code Markdown+Math extension).
- Reference variable names
MUST
end in either_ref
or_ref_mut
, depending on mutability, unless they refer to signers. - Doc comments
MUST
use Markdown syntax. - Variable names
SHOULD
be descriptive, with minor exceptions for scenarios like math utility functions. - Error code names
MUST
start withE_
, for exampleE_NOT_ENOUGH_BASE
. - Where possible, functions of the form
ensure_property_x()
, which ensure that some property holds,SHALL
be favored over functions of the formassert_property_x()
, which abort if a property does not hold. - Until a formatter or linter is available, lines
SHALL
break at 100 characters per the Move formatting guidelines. - Events
SHALL
be titled in the formSomething
, as opposed toSomethingEvent
, andSHALL
be emitted v2-style, consistent with the Aptos Framework v2 event refactors.