-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathAVIOCustomRuleConfiguration.groovy
57 lines (46 loc) · 1.97 KB
/
AVIOCustomRuleConfiguration.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import com.avioconsulting.mule.linter.model.CaseNaming
import com.avioconsulting.mule.linter.model.rule.RuleSet
import com.avioconsulting.mule.linter.model.CaseNaming
import com.avioconsulting.mule.linter.rule.cicd.*
import com.avioconsulting.mule.linter.rule.configuration.*
import com.avioconsulting.mule.linter.rule.git.*
import com.avioconsulting.mule.linter.rule.muleartifact.*
import com.avioconsulting.mule.linter.rule.pom.*
import com.avioconsulting.mule.linter.rule.property.*
import com.avioconsulting.mule.linter.model.rule.*
class AVIOCustomRuleConfiguration {
static final List<String> ENVIRONMENTS = ['dev','test','prod']
static final String GLOBALS_FILENAME = 'global(.*).xml'
static RuleSet getRules() {
RuleSet rules = new RuleSet()
JenkinsFileExistsRule jk = new JenkinsFileExistsRule()
//cicd
rules.addRule(jk)
//configuration
rules.addRule(new ConfigFileNamingRule(CaseNaming.CaseFormat.KEBAB_CASE))
rules.addRule(new FlowSubflowNamingRule(CaseNaming.CaseFormat.KEBAB_CASE))
rules.addRule(new GlobalConfigNoFlowsRule(GLOBALS_FILENAME))
rules.addRule(new GlobalConfigRule(GLOBALS_FILENAME))
rules.addRule(new LoggerCategoryExistsRule())
rules.addRule(new LoggerMessageExistsRule())
rules.addRule(new OnErrorLogExceptionRule())
rules.addRule(new UnusedFlowRule())
//git
rules.addRule(new GitIgnoreRule())
//muleArtifact
rules.addRule(new MuleArtifactHasSecurePropertiesRule())
rules.addRule(new MuleArtifactMinMuleVersionRule())
//pom
rules.addRule(new MuleMavenPluginVersionRule('3.3.5'))
rules.addRule(new MuleRuntimeVersionRule('4.2.1'))
rules.addRule(new MunitMavenPluginAttributesRule())
rules.addRule(new MunitVersionRule('2.2.1'))
rules.addRule(new PomExistsRule())
//property
rules.addRule(new EncryptedPasswordRule())
rules.addRule(new PropertyExistsRule('db.user', ENVIRONMENTS))
rules.addRule(new PropertyFileNamingRule(ENVIRONMENTS))
rules.addRule(new PropertyFilePropertyCountRule(ENVIRONMENTS))
return rules
}
}