()
| 127 | } |
| 128 | |
| 129 | func InitAssetsService() *service.Service { |
| 130 | setup() |
| 131 | |
| 132 | paths, err := file.ReadLocalFileStructure(root, config.Default.ValidatorsSettings.RootFolder.SkipFiles) |
| 133 | if err != nil { |
| 134 | log.WithError(err).Fatal("Failed to load file structure.") |
| 135 | } |
| 136 | |
| 137 | paths = filter(paths, func(path string) bool { |
| 138 | for _, dir := range config.Default.ValidatorsSettings.RootFolder.SkipDirs { |
| 139 | if strings.Contains(path, dir) { |
| 140 | return false |
| 141 | } |
| 142 | } |
| 143 | return true |
| 144 | }) |
| 145 | |
| 146 | fileService := file.NewService(paths...) |
| 147 | validatorsService := processor.NewService(fileService) |
| 148 | reportService := report.NewService() |
| 149 | |
| 150 | return service.NewService(fileService, validatorsService, reportService, paths) |
| 151 | } |
| 152 | |
| 153 | func setup() { |
| 154 | if err := config.SetConfig(configPath); err != nil { |
no test coverage detected
searching dependent graphs…