Skip to content

Commit

Permalink
feat(typescript): add lint husky typechain
Browse files Browse the repository at this point in the history
  • Loading branch information
zgorizzo69 committed Sep 22, 2021
1 parent 9a81ea3 commit b2b055b
Show file tree
Hide file tree
Showing 97 changed files with 13,563 additions and 2,028 deletions.
4 changes: 3 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
INFURA_KEY=
ALCHEMY_KEY=
PRIVATE_KEY=
PRIVATE_KEY=
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=
56 changes: 56 additions & 0 deletions .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: meTokens CI

on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v2
with:
path: "**/node_modules"
key: nodeModules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install packages
run: yarn --frozen-lockfile
env:
CI: true

- name: lint
run: yarn lint
env:
CI: true

- name: Compile
run: yarn compile
env:
CI: true

- name: Test Deployment
run: yarn deploy-local
env:
CI: true

- name: Test
run: yarn test
env:
CI: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package-lock.json
node_modules

abi/
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.16.0
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage
node_modules
build
cache
artifacts
deployments
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
}
]
}
4 changes: 4 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
testCommand: " mocha --exit --recursive test",
skipFiles: ["interfaces", "mocks"],
};
3 changes: 3 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
contracts/interfaces
contracts/libs/Details.sol
node_modules
46 changes: 46 additions & 0 deletions .solhintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
extends: "solhint:recommended",
plugins: ["prettier"],
rules: {
"prettier/prettier": "error",
"code-complexity": ["error", 10],
"function-max-lines": ["error", 100],
"max-line-length": ["error", 100],
"max-states-count": ["error", 20],
"no-empty-blocks": "error",
"no-unused-vars": "error",
"payable-fallback": "off",
"reason-string": ["off", { maxLength: 32 }],
"constructor-syntax": "off",
"comprehensive-interface": "off",
quotes: ["error", "double"],
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": ["error", { strict: false }],
"var-name-mixedcase": "error",
"imports-on-top": "error",
ordering: "error",
"visibility-modifier-order": "error",
"avoid-call-value": "off",
"avoid-low-level-calls": "off",
"avoid-sha3": "error",
"avoid-suicide": "error",
"avoid-throw": "error",
"avoid-tx-origin": "off",
"check-send-result": "error",
"compiler-version": ["error", ">=0.6.0"],
"mark-callable-contracts": "off",
"func-visibility": ["error", { ignoreConstructors: true }],
"multiple-sends": "error",
"no-complex-fallback": "error",
"no-inline-assembly": "off",
"not-rely-on-block-hash": "error",
reentrancy: "error",
"state-visibility": "error",
"not-rely-on-time": "off",
},
};
Loading

0 comments on commit b2b055b

Please sign in to comment.