-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize codebase #296
Merged
eztierney
merged 22 commits into
circlefin:master
from
CoinbaseStablecoin:modernize-codebase
May 22, 2020
Merged
Modernize codebase #296
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2e804ea
Autoformat code using Prettier
petejkim 9544b92
Update npm packages
petejkim 20c4053
Update Dockerfile
petejkim 61c3997
Update Travis config
petejkim ac48f00
Fix solidty-coverage
petejkim 9343b15
Autoformat Markdown files
petejkim 7172076
Fix tests that broke due to Truffle upgrade
petejkim 332ab67
Remove unused dependencies
petejkim e7b44a2
Setup ESLint
petejkim 9771630
Fix lint errors and tests
petejkim 626553f
Cleanup migrations
petejkim f0480e8
Set up TypeScript
petejkim 3bb1363
Move V1 tests to test/v1 and fix lint errors
petejkim 8592ac2
Rename mock upgraded contract
petejkim 58f79be
Add storage slot test to ensure slots are retained
petejkim 3f1c4cf
Set up solhint
petejkim abfbe60
Upgrade contracts to solidity v0.6.8
petejkim 6b53b46
Add pre-commit hook
petejkim 4c42934
Reorganize test files
petejkim 23a0a2d
Add SPDX license identifier
petejkim fdafe06
Ensure locally installed prettier is used to format Solidity code
petejkim 283eca9
Update notes in forked contracts
petejkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules/ | ||
coverage/ | ||
@types/generated/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@types/generated/**/* linguist-generated=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
node_modules/ | ||
coverage/ | ||
@types/generated/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected] | ||
- yarn install --frozen-lockfile | ||
|
||
script: | ||
- yarn check --integrity && truffle compile && npm test | ||
- yarn ganache & sleep 5 && yarn test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"juanblanco.solidity" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to remove
check --integrity
? Is it no longer needed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's deprecated and removed from Yarn 2.x for being unreliable. It also fails when there are cross-platform differences. Since we are not bundling
node_modules
in this repo, it shouldn't be necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that makes sense. We were trying to stop
openzeppelin-solidity
andzos-lib
from being modified, but it looks like the lock file is enough to handle this. I guess we never needed check-integritr.y