feat: add arch ignore rueles

上级 3af471ca
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
type ArchCmdConfig struct { type ArchCmdConfig struct {
DependencePath string DependencePath string
IsMergePackage bool IsMergePackage bool
FilterString string
} }
var ( var (
...@@ -33,14 +34,14 @@ var archCmd = &cobra.Command{ ...@@ -33,14 +34,14 @@ var archCmd = &cobra.Command{
archApp := arch.NewArchApp() archApp := arch.NewArchApp()
result := archApp.Analysis(parsedDeps, identifiersMap) result := archApp.Analysis(parsedDeps, identifiersMap)
ignores := strings.Split("", ",") filter := strings.Split(archCmdConfig.FilterString, ",")
var nodeFilter = func(key string) bool { var nodeFilter = func(key string) bool {
for _, f := range ignores { for _, f := range filter {
if key == f { if strings.Contains(key, f) {
return true return false
} }
} }
return false return true
} }
...@@ -63,4 +64,5 @@ func init() { ...@@ -63,4 +64,5 @@ func init() {
archCmd.PersistentFlags().StringVarP(&archCmdConfig.DependencePath, "dependence", "d", config.CocaConfig.ReporterPath+"/deps.json", "get dependence file") archCmd.PersistentFlags().StringVarP(&archCmdConfig.DependencePath, "dependence", "d", config.CocaConfig.ReporterPath+"/deps.json", "get dependence file")
archCmd.PersistentFlags().BoolVarP(&archCmdConfig.IsMergePackage, "mergePackage", "P", false, "merge package/folder for include dependencies") archCmd.PersistentFlags().BoolVarP(&archCmdConfig.IsMergePackage, "mergePackage", "P", false, "merge package/folder for include dependencies")
archCmd.PersistentFlags().StringVarP(&archCmdConfig.FilterString, "filter", "x", "", "filter -x com.phodal")
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册