mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Merge pull request #74 from Instadapp/cl-args-to-set-check-path
cl args to set check path
This commit is contained in:
commit
417bf6795a
|
@ -53,4 +53,3 @@ Few things to consider while writing the connector:
|
|||
### Support
|
||||
|
||||
If you can't find something you're looking for or have any questions, ask them at our developers community on [Discord](https://discord.gg/83vvrnY) or simply send an [Email](mailto:info@instadapp.io).
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"scripts": {
|
||||
"test": "hardhat test",
|
||||
"coverage": "./node_modules/.bin/solidity-coverage",
|
||||
"check": "node status-checks/huskyCheck.js",
|
||||
"check-husky": "node status-checks/huskyCheck.js",
|
||||
"build-contracts": "sol-merger \"./contracts/connectors/mock.sol\" ./contracts/build"
|
||||
},
|
||||
|
|
|
@ -3,13 +3,11 @@ const path = require('path')
|
|||
|
||||
const forbiddenStrings = ['selfdestruct']
|
||||
|
||||
const getConnectorsList = async () => {
|
||||
const getConnectorsList = async (connectorsRootsDirs) => {
|
||||
try {
|
||||
const connectors = []
|
||||
const connectorsRootsDirs = ['mainnet', 'polygon']
|
||||
for (let index = 0; index < connectorsRootsDirs.length; index++) {
|
||||
const root = `contracts/${connectorsRootsDirs[index]}/connectors`
|
||||
const dirs = [root]
|
||||
const dirs = [connectorsRootsDirs[index]]
|
||||
while (dirs.length) {
|
||||
const currentDir = dirs.pop()
|
||||
const subs = fs.readdirSync(currentDir, { withFileTypes: true })
|
||||
|
@ -326,9 +324,14 @@ const checkHeadComments = async (connector) => {
|
|||
|
||||
async function checkMain () {
|
||||
try {
|
||||
const connectorsRootsDirsDefault = ['mainnet', 'polygon'].map(v=> `contracts/${v}/connectors`)
|
||||
const customPathArg = process.argv.find(a => a.startsWith('connector='))
|
||||
const connectorsRootsDirs = customPathArg
|
||||
? [customPathArg.slice(10)]
|
||||
: connectorsRootsDirsDefault
|
||||
const errors = []
|
||||
const warnings = []
|
||||
const connectors = await getConnectorsList()
|
||||
const connectors = await getConnectorsList(connectorsRootsDirs)
|
||||
for (let index = 0; index < connectors.length; index++) {
|
||||
const { forbiddenErrors, code } = await checkForbidden(connectors[index].path)
|
||||
connectors[index].code = code
|
||||
|
|
7
status-checks/readme.md
Normal file
7
status-checks/readme.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
# Check run
|
||||
|
||||
use
|
||||
`npm run check`
|
||||
to check `connectors` directory. Use `connector=$` argument to check specific connector:
|
||||
`npm run check connector=contracts/mainnet/common`
|
Loading…
Reference in New Issue
Block a user