-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: init basic api check for rule
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 18 additions & 1 deletion
19
code-quality/src/main/kotlin/cc/unitmesh/quality/ExtRuleAnalyser.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
package cc.unitmesh.quality | ||
|
||
import org.archguard.linter.rule.sql.DatamapRuleVisitor | ||
import org.archguard.linter.rule.sql.SqlRuleSetProvider | ||
import org.archguard.linter.rule.webapi.WebApiRuleSetProvider | ||
import org.archguard.linter.rule.webapi.WebApiRuleVisitor | ||
import org.archguard.rule.core.Issue | ||
import org.archguard.scanner.core.sourcecode.CodeDatabaseRelation | ||
import org.archguard.scanner.core.sourcecode.ContainerService | ||
|
||
class ExtRuleAnalyser { | ||
// check with WebAPI, SQL or Other rule by ArchGuard | ||
val webApiRuleSetProvider = WebApiRuleSetProvider() | ||
val sqlRuleSetProvider = SqlRuleSetProvider() | ||
|
||
fun checkApi(services: List<ContainerService>): List<Issue> { | ||
return WebApiRuleVisitor(services).visitor(listOf(webApiRuleSetProvider.get())) | ||
} | ||
|
||
fun checkSql(relations: List<CodeDatabaseRelation>): List<Issue> { | ||
return DatamapRuleVisitor(relations).visitor(listOf(sqlRuleSetProvider.get())) | ||
} | ||
} |
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