Skip to content

Commit

Permalink
feat: add arch ignore rueles
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 17, 2020
1 parent 3af471c commit ff9ff86
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
type ArchCmdConfig struct {
DependencePath string
IsMergePackage bool
FilterString string
}

var (
Expand All @@ -33,14 +34,14 @@ var archCmd = &cobra.Command{
archApp := arch.NewArchApp()
result := archApp.Analysis(parsedDeps, identifiersMap)

ignores := strings.Split("", ",")
filter := strings.Split(archCmdConfig.FilterString, ",")
var nodeFilter = func(key string) bool {
for _, f := range ignores {
if key == f {
return true
for _, f := range filter {
if strings.Contains(key, f) {
return false
}
}
return false
return true
}


Expand All @@ -63,4 +64,5 @@ func init() {

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().StringVarP(&archCmdConfig.FilterString, "filter", "x", "", "filter -x com.phodal")
}

0 comments on commit ff9ff86

Please sign in to comment.