Skip to content

Instantly share code, notes, and snippets.

@pablofullana
Last active November 2, 2018 19:19
Show Gist options
  • Save pablofullana/5c1e062de0ef15e88996f3a0a17684fd to your computer and use it in GitHub Desktop.
Save pablofullana/5c1e062de0ef15e88996f3a0a17684fd to your computer and use it in GitHub Desktop.
Solhint rules whitelisting
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'
}
{
// ...
"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