예제 #1
0
파일: Files.java 프로젝트: BIORIMP/biorimp
 private synchronized void ensureDirectoryScannerSetup() {
   dieOnCircularReference();
   if (ds == null) {
     ds = new DirectoryScanner();
     PatternSet ps = mergePatterns(getProject());
     ds.setIncludes(ps.getIncludePatterns(getProject()));
     ds.setExcludes(ps.getExcludePatterns(getProject()));
     ds.setSelectors(getSelectors(getProject()));
     if (useDefaultExcludes) {
       ds.addDefaultExcludes();
     }
     ds.setCaseSensitive(caseSensitive);
     ds.setFollowSymlinks(followSymlinks);
   }
 }
예제 #2
0
  private Collection<Violation> parseReportIn(
      final String baseDir, final SwiftLintReportParser parser) {

    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setIncludes(new String[] {reportPath()});
    scanner.setBasedir(baseDir);
    scanner.setCaseSensitive(false);
    scanner.scan();
    String[] files = scanner.getIncludedFiles();

    Collection<Violation> result = new ArrayList<Violation>();
    for (String filename : files) {
      LOGGER.info("Processing SwiftLint report {}", filename);
      result.addAll(parser.parseReport(new File(filename)));
    }

    return result;
  }