Last active
November 2, 2018 19:19
-
-
Save pablofullana/5c1e062de0ef15e88996f3a0a17684fd to your computer and use it in GitHub Desktop.
Solhint rules whitelisting
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
const security = require('./security/index') | |
const naming = require('./naming/index') | |
const order = require('./order/index') | |
const align = require('./align/index') | |
const bestPractises = require('./best-practises/index') | |
const deprecations = require('./deprecations/index') | |
const miscellaneous = require('./miscellaneous/index') | |
const configObject = require('./../config') | |
module.exports = function checkers(reporter, configVals, inputSrc, fileName) { | |
const config = configObject.from(configVals) | |
const effectiveConfig = effectiveConfig(config) //consider moving this to a previous step | |
// filter out all those rules that are not present in the effectiveConfig.rules array | |
return buildAllRules().filter(checker => ruleEnabled(effectiveConfig.rules[checker.id])) | |
} | |
function buildAllRules() { | |
return [coreRules() + pluginsRules()] | |
} | |
function coreRules() { | |
throw 'to be implemented' | |
} | |
function pluginsRules() { | |
throw 'to be implemented' | |
} |
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
{ | |
// ... | |
"rules": [ | |
"security_1": "on", | |
"security_2": "on", | |
"align_everything!": "on" | |
// ... | |
], | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment