DetektAnalyzer implements Analyzer<List<TypedDetektFinding>> { public DetektResult analyze() { final File baseDir = new File(AnalyzerConfig.Path.commonBase(config.getSourcePaths(KOTLIN)).getPath()); try { final PrintStream printStream = new PrintStream(new LoggingOutputStream(), true, "utf-8"); final ProcessingSettings settings = new ProcessingSettings( singletonList(baseDir.toPath()), calcDetektConfig(), null, false, false, emptyList(), emptyList(), LanguageVersion.KOTLIN_1_3, JvmTarget.JVM_1_8, Executors.newSingleThreadExecutor(), printStream, printStream, false, false, emptyList()); final DetektFacade df = DetektFacade.Companion.create(settings, ruleSetProviders(settings), emptyList()); return createResult(baseDir, df.run()); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } } DetektAnalyzer(AnalyzerConfig config, DetektCollector collector); private  DetektAnalyzer(AnalyzerConfig config, DetektCollector collector, Config detektConfig,
                           List<RuleSetProvider> ruleSetProviders); DetektAnalyzer withConfig(Config detektConfig); DetektAnalyzer withRuleSets(RuleSetProvider... providers); DetektResult analyze();  }
@Test void analyze() { final DetektResult result = new DetektAnalyzer(AnalyzerConfig.maven(KOTLIN).mainAndTest(), new DetektCollector() .just(In.classes("Linker").ignore("MaxLineLength"))) .analyze(); assertMatcher("" + line(Style, "style", "NewLineAtEndOfFile", "Linker", 59, "Checks whether files end with a line separator."), result, hasNoDetektIssues()); }