Skip to content

Commit

Permalink
Merge pull request #296 from CoinbaseStablecoin/modernize-codebase
Browse files Browse the repository at this point in the history
Modernize codebase
  • Loading branch information
eztierney committed May 22, 2020
2 parents 835c997 + 283eca9 commit 8aa0ddf
Show file tree
Hide file tree
Showing 97 changed files with 21,757 additions and 11,163 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "stage-2", "stage-3", "env"]
"presets": ["es2015", "stage-2", "stage-3", "env"]
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules/
coverage/
@types/generated/
52 changes: 52 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = {
root: true,
env: {
es2020: true,
node: true,
mocha: true,
},
globals: {
artifacts: "readonly",
contract: "readonly",
assert: "readonly",
web3: true,
},
overrides: [
{
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/no-use-before-define": [
"error",
{ functions: false, classes: false },
],
"prettier/prettier": "warn",
},
},
{
files: ["**/*.js"],
extends: [
"eslint:recommended",
"standard",
"plugin:prettier/recommended",
],
rules: {
camelcase: "error",
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"prettier/prettier": "warn",
"no-var": "error",
},
},
],
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@types/generated/**/* linguist-generated=true

15 changes: 15 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".

root_dir=$(git rev-parse --git-dir)
root_dir=$(cd $root_dir > /dev/null && cd .. > /dev/null && pwd -P)

cd $root_dir

yarn precommit
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
.DS_Store
build/
node_modules/
coverage/
coverage.json
package-lock.json
.idea/
#local codebuild results
artifacts/
.DS_Store
contracts/.DS_Store
token.json
credentials.json
echidna/
validate/apikey.infura
ganache-blockchain-log.txt
.coverage_artifacts
.coverage_contracts
yarn-error.log
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
node_modules/
coverage/
@types/generated/

30 changes: 30 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"overrides": [
{
"files": "*.sol",
"options": {
"tabWidth": 4,
"explicitTypes": "always"
}
},
{
"files": "*.md",
"options": {
"proseWrap": "always"
}
}
]
}
12 changes: 7 additions & 5 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module.exports = {
providerOptions: {
port: 8555,
testrpcOptions: '-p 8555 -d --accounts 15',
skipFiles: [
'test/'
],
copyPackages: ['openzeppelin-solidity', 'zos-lib']
seed: "TestRPC is awesome!",
total_accounts: 15,
default_balance_ether: 1000000,
},
skipFiles: ["test/"],
copyPackages: ["openzeppelin-solidity", "zos-lib"],
};
7 changes: 7 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.6.0"],
"reason-string": ["warn", { "maxLength": 64 }]
}
}
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
language: node_js
node_js:
- 8
- 12

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.9.2
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"


install:
- npm install -g truffle@4.1.13
- yarn install --frozen-lockfile

script:
- yarn check --integrity && truffle compile && npm test
- yarn ganache & sleep 5 && yarn test

7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"juanblanco.solidity"
]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/node_modules/": true
},
"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules",
"solidity.formatter": "none",
"files.trimTrailingWhitespace": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"[javascript]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"[markdown]": {
"editor.formatOnSave": true
},
"[solidity]": {
"editor.tabSize": 4,
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
}
}
Loading

0 comments on commit 8aa0ddf

Please sign in to comment.