aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-22 06:57:16 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-22 06:57:16 +0800
commite144ebbb936c74b4af0e1c1776578208ea148de4 (patch)
treec5ab2823603b25d11d46493e9c8f79801bef0dcd /CONTRIBUTING.md
parentaa9aa1f58a4e63b5e5c7863f3b7afb020d7712c5 (diff)
parent9b540fd8e52e7578d3749e6d9ef9cd97d602ffb3 (diff)
downloaddexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.gz
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.bz2
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.lz
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.xz
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.zst
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.zip
Merge branch 'development' into feature/instant/tell-amount-available
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1fea8f501..3e709b36f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -79,7 +79,20 @@ If using the Atom text editor, we recommend you install the following packages:
* VSCode: [prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
* Atom: [prettier-atom](https://atom.io/packages/prettier-atom)
-## Fix `submit-coverage` CI failure
+## Unenforced coding conventions
+
+A few of our coding conventions are not yet enforced by the linter/auto-formatter. Be careful to follow these conventions in your PR's.
+
+1. Unused anonymous function parameters should be named with an underscore + number (e.g \_1, \_2, etc...)
+1. There should be a new-line between methods in a class and between test cases.
+1. If a string literal has the same value in two or more places, it should be a single constant referenced in both places.
+1. Do not import from a project's `index.ts` (e.g import { Token } from '../src';). Always import from the source file itself.
+1. Generic error variables should be named `err` instead of `e` or `error`.
+1. If you _must_ cast a variable to any - try to type it back as fast as possible. (e.g., `const cw = ((zeroEx as any)._contractWrappers as ContractWrappers);`). This ensures subsequent code is type-safe.
+1. Our enum conventions coincide with the recommended Typescript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
+1. All public, exported methods/functions/classes must have associated Javadoc-style comments.
+
+### Fix `submit-coverage` CI failure
If you simply fork the repo and then create a PR from it, your PR will fail the `submit-coverage` check on CI. This is because the 0x CircleCI configuration sets the `COVERALLS_REPO_TOKEN` environment variable to the token for `0xProject/0x-monorepo`, but when running the check against your fork the token needs to match your repo's name `your-username/0x-monorepo`.