Skip to content

Commit

Permalink
cflint#527 CFLint now ignoring all directories starting with "." and …
Browse files Browse the repository at this point in the history
…not even scanning in them.
  • Loading branch information
TheRealAgentK committed Jan 3, 2018
1 parent 9ede6ae commit 0c2157b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class CFLint implements IErrorReporter {

// Stack to store include file depth to ensure no recursion
private final Stack<File> includeFileStack = new Stack<>();
private int[] lineOffsets;
private int[] lineOffsets;

public CFLint(final CFLintConfiguration configFile) throws IOException {
final CFLintFilter filter = CFLintFilter.createFilter(verbose);
Expand Down Expand Up @@ -238,6 +238,7 @@ public void setupConfigAncestry(File folder) {
}

public void scan(final File folderOrFile) {

if (debug) {
System.out.println("Current file: " + folderOrFile.getAbsolutePath());
}
Expand All @@ -250,6 +251,13 @@ public void scan(final File folderOrFile) {
return;
}
if (folderOrFile.isDirectory()) {
if (verbose) {
if (folderOrFile.getName().startsWith("."))
{
System.out.println("Skipping folder and its children: " + folderOrFile.getAbsolutePath());
return;
}
}
final CFLintConfiguration saveConfig = configuration;
try {
for (final File file : folderOrFile.listFiles()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cflint/tools/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static boolean checkExtension(final File file, final List<String> allowed
}
return false;
}

/**
* Read from reader till EOF.
* @param rdr the reader from which to read.
Expand Down

0 comments on commit 0c2157b

Please sign in to comment.