|
10 | 10 | import com.premiumminds.sonar.postgres.visitors.BanCharFieldVisitorCheck; |
11 | 11 | import com.premiumminds.sonar.postgres.visitors.BanCreateDomainWithConstraintCheck; |
12 | 12 | import com.premiumminds.sonar.postgres.visitors.BanDropDatabaseVisitorCheck; |
| 13 | +import com.premiumminds.sonar.postgres.visitors.BanTruncateCascade; |
13 | 14 | import com.premiumminds.sonar.postgres.visitors.ChangingColumnTypeVisitorCheck; |
14 | 15 | import com.premiumminds.sonar.postgres.visitors.ClusterVisitorCheck; |
15 | 16 | import com.premiumminds.sonar.postgres.visitors.ConcurrentVisitorCheck; |
@@ -46,6 +47,7 @@ public class PostgresSqlRulesDefinition implements RulesDefinition { |
46 | 47 | public static final RuleKey RULE_BAN_CHAR_FIELD = RuleKey.of(REPOSITORY, "ban-char-field"); |
47 | 48 | public static final RuleKey RULE_BAN_CREATE_DOMAIN_WITH_CONSTRAINT = RuleKey.of(REPOSITORY, "ban-create-domain-with-constraint"); |
48 | 49 | public static final RuleKey RULE_BAN_ALTER_DOMAIN_WITH_CONSTRAINT = RuleKey.of(REPOSITORY, "ban-alter-domain-with-add-constraint"); |
| 50 | + public static final RuleKey RULE_BAN_TRUNCATE_CASCADE = RuleKey.of(REPOSITORY, "ban-truncate-cascade"); |
49 | 51 | public static final RuleKey RULE_BAN_DROP_DATABASE = RuleKey.of(REPOSITORY, "ban-drop-database"); |
50 | 52 | public static final RuleKey RULE_CHANGING_COLUMN_TYPE = RuleKey.of(REPOSITORY, "changing-column-type"); |
51 | 53 | public static final RuleKey RULE_CONSTRAINT_MISSING_NOT_VALID = RuleKey.of(REPOSITORY, "constraint-missing-not-valid"); |
@@ -119,6 +121,11 @@ public void define(Context context) { |
119 | 121 | .setType(RuleType.BUG) |
120 | 122 | .setMarkdownDescription(getClass().getResource("ban-alter-domain-with-add-constraint.md")); |
121 | 123 |
|
| 124 | + repository.createRule(RULE_BAN_TRUNCATE_CASCADE.rule()) |
| 125 | + .setName("ban-truncate-cascade") |
| 126 | + .setType(RuleType.BUG) |
| 127 | + .setMarkdownDescription(getClass().getResource("ban-truncate-cascade.md")); |
| 128 | + |
122 | 129 | repository.createRule(RULE_BAN_DROP_DATABASE.rule()) |
123 | 130 | .setName("ban-drop-database rule") |
124 | 131 | .setType(RuleType.BUG) |
@@ -220,6 +227,7 @@ public static List<VisitorCheck> allChecks(){ |
220 | 227 | new BanCharFieldVisitorCheck(), |
221 | 228 | new BanCreateDomainWithConstraintCheck(), |
222 | 229 | new BanAlterDomainWithConstraintCheck(), |
| 230 | + new BanTruncateCascade(), |
223 | 231 | new PreferTextFieldVisitorCheck(), |
224 | 232 | new VacuumFullVisitorCheck(), |
225 | 233 | new ClusterVisitorCheck(), |
|
0 commit comments