mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
chore: config linting, formatting and git hooks
This commit is contained in:
parent
7295ad39fe
commit
fc92050590
|
@ -21,10 +21,16 @@ jobs: # a collection of steps
|
|||
- run: # Compile
|
||||
name: Compile
|
||||
command: npx buidler compile
|
||||
- run: # Formatting
|
||||
name: Prettier Check
|
||||
command: yarn prettier --check .
|
||||
- run: # Linting
|
||||
name: ESLint
|
||||
command: yarn eslint .
|
||||
- run: # Tests
|
||||
name: Tests using buidler-ganache mainnet fork
|
||||
command: npx buidler test
|
||||
# - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
|
||||
# path: coverage
|
||||
# prefix: coverage
|
||||
# See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples
|
||||
# See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples
|
||||
|
|
13
.eslintrc.json
Normal file
13
.eslintrc.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"env": {
|
||||
"commonjs": true,
|
||||
"es2021": true,
|
||||
"node": true,
|
||||
"mocha": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "prettier"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12
|
||||
},
|
||||
"rules": {}
|
||||
}
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -8,6 +8,9 @@ node_modules
|
|||
artifacts/
|
||||
cache/
|
||||
|
||||
# ESLint
|
||||
.eslintcache
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
*.icloud
|
||||
|
|
9
.prettierignore
Normal file
9
.prettierignore
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Ignore artifacts:
|
||||
#artifacts
|
||||
cache
|
||||
assets
|
||||
coverage
|
||||
|
||||
# Solidity
|
||||
contracts
|
||||
#pre-compiles
|
1
.prettierrc.json
Normal file
1
.prettierrc.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
20
.vscode/settings.json
vendored
20
.vscode/settings.json
vendored
|
@ -1,19 +1,5 @@
|
|||
{
|
||||
// HTML
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
// Javascript
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
// JSON
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
// Solidity
|
||||
"solidity.formatter": "none",
|
||||
"solidity.linter": "solhint",
|
||||
|
@ -21,9 +7,5 @@
|
|||
"solidity.packageDefaultDependenciesDirectory": "node_modules",
|
||||
"solidity.solhintRules": {
|
||||
"quotes": ["error", "double"]
|
||||
},
|
||||
// Typscript
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Buidler
|
||||
const { task, usePlugin, types } = require("@nomiclabs/buidler/config");
|
||||
|
||||
// Libraries
|
||||
const assert = require("assert");
|
||||
const { utils } = require("ethers");
|
||||
|
@ -114,13 +117,13 @@ task(
|
|||
)
|
||||
.addOptionalParam("gelatocoreaddress")
|
||||
.addFlag("log", "Logs return values to stdout")
|
||||
.setAction(async (taskArgs) => {
|
||||
.setAction(async (taskArgs, bre) => {
|
||||
try {
|
||||
const gelatoCore = await ethers.getContractAt(
|
||||
const gelatoCore = await bre.ethers.getContractAt(
|
||||
GelatoCoreLib.GelatoCore.abi,
|
||||
taskArgs.gelatocoreaddress
|
||||
? taskArgs.gelatocoreaddress
|
||||
: network.config.GelatoCore
|
||||
: bre.network.config.GelatoCore
|
||||
);
|
||||
|
||||
const oracleAbi = ["function latestAnswer() view returns (int256)"];
|
||||
|
@ -128,7 +131,7 @@ task(
|
|||
const gelatoGasPriceOracleAddress = await gelatoCore.gelatoGasPriceOracle();
|
||||
|
||||
// Get gelatoGasPriceOracleAddress
|
||||
const gelatoGasPriceOracle = await ethers.getContractAt(
|
||||
const gelatoGasPriceOracle = await bre.ethers.getContractAt(
|
||||
oracleAbi,
|
||||
gelatoGasPriceOracleAddress
|
||||
);
|
||||
|
|
37
package.json
37
package.json
|
@ -5,18 +5,39 @@
|
|||
"repository": "https://github.com/gelatodigital/gelato-instadapp",
|
||||
"author": "gitpusha",
|
||||
"private": false,
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"rebase": "HUSKY_SKIP_HOOKS=1 git rebase",
|
||||
"compile": "npx buidler compile",
|
||||
"format": "prettier --write .",
|
||||
"lint": "eslint --cache .",
|
||||
"lint:fix": "eslint --cache --fix .",
|
||||
"test": "npx buidler test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gelatonetwork/core": "0.5.3",
|
||||
"@nomiclabs/buidler": "1.4.7",
|
||||
"@nomiclabs/buidler-ethers": "2.0.0",
|
||||
"@nomiclabs/buidler-ganache": "^1.3.3",
|
||||
"@nomiclabs/buidler-ethers": "2.0.2",
|
||||
"@nomiclabs/buidler-ganache": "1.3.3",
|
||||
"@nomiclabs/buidler-waffle": "2.1.0",
|
||||
"chai": "^4.2.0",
|
||||
"chai": "4.2.0",
|
||||
"dotenv": "8.2.0",
|
||||
"ethereum-waffle": "3.1.0",
|
||||
"ethers": "5.0.14",
|
||||
"prettier": "2.0.5"
|
||||
"eslint": "7.10.0",
|
||||
"eslint-config-prettier": "6.12.0",
|
||||
"ethereum-waffle": "3.1.1",
|
||||
"ethers": "5.0.17",
|
||||
"husky": ">=4",
|
||||
"lint-staged": ">=10",
|
||||
"prettier": "2.1.2"
|
||||
},
|
||||
"dependencies": {}
|
||||
"dependencies": {},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "yarn compile; lint-staged;",
|
||||
"pre-push": "git fetch origin && HUSKY_SKIP_HOOKS=1 git rebase origin/master && yarn compile && lint-staged; yarn test"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": "eslint --cache --fix",
|
||||
"*.{js,css,md}": "prettier --write"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ const { expect } = require("chai");
|
|||
const bre = require("@nomiclabs/buidler");
|
||||
const { ethers } = bre;
|
||||
const GelatoCoreLib = require("@gelatonetwork/core");
|
||||
const { sleep } = GelatoCoreLib;
|
||||
//const { sleep } = GelatoCoreLib;
|
||||
|
||||
// Constants
|
||||
const ETH = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
||||
|
|
|
@ -4,7 +4,7 @@ const { expect } = require("chai");
|
|||
const bre = require("@nomiclabs/buidler");
|
||||
const { ethers } = bre;
|
||||
const GelatoCoreLib = require("@gelatonetwork/core");
|
||||
const { sleep } = GelatoCoreLib;
|
||||
//const { sleep } = GelatoCoreLib;
|
||||
|
||||
// Constants
|
||||
const DAI_100 = ethers.utils.parseUnits("100", 18);
|
||||
|
|
Loading…
Reference in New Issue
Block a user