Skip to content

Commit 0c558d7

Browse files
authored
Update customRulesSetup.md
1 parent 3c5506d commit 0c558d7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/customRulesSetup.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ Currently, plugin supports ability to match code against custom rules defined in
44

55

66
### Usage ###
7-
To use custom rules, you have to define an xml file with
8-
- use custom rules as adhoc rules
97

10-
11-
#### Using custom rules as adhoc rules ####
128
- Create an xml file with custom rules defined, there is an [example file](https://github.com/gretard/sonar-sql-plugin/blob/master/examples/1-tsql/myExampleRepo.customRules). Each file defines a single repository.
139
- Put custom file into your base directory of the project or you can specify absolute path to the file.
1410
- Run sonar scanner
1511

12+
13+
1614
### Creating custom rules ###
1715
Custom rules are defined using xml format. Each file should be defining a single repository using format described below. Attributes repoName and repoKey defines repository's name and key used by SonarQube. All keys should be unique.
1816

@@ -25,7 +23,7 @@ Mandatory fields for rule:
2523
- severity
2624
- ruleType - can be BUG, CODE_SMELL
2725
- ruleImplementation - defines how to detect code against which rules will be applied. There are different options for this item:
28-
- names - defines a list of SQL parser classes on which rule will be applied. Full list is specified below (TSQL, MYSQL, [PSSQL])
26+
- names - defines a list of SQL parser classes on which rule will be applied. Full list is specified below ([TSQL](https://github.com/gretard/sonar-sql-plugin/blob/master/docs/tsqlClasses.md), [MYSQL](https://github.com/gretard/sonar-sql-plugin/blob/master/docs/mysqlClasses.md), [PSSQL](https://github.com/gretard/sonar-sql-plugin/blob/master/docs/pssqlClasses.md) )
2927
- textToFind - defines custom text which will be looked for in the applicable nodes
3028
- parentRules - defines array of rules of type ruleImplementation which will be applied for node's parents
3129
- childrenRules - defines array of rules of type ruleImplementation which will be applied for node's children

0 commit comments

Comments
 (0)