-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
4 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
cxx-checks/src/main/java/org/sonar/cxx/checks/XPathCheck.java
This file was deleted.
Oops, something went wrong.
101 changes: 0 additions & 101 deletions
101
cxx-checks/src/test/java/org/sonar/cxx/checks/XPathCheckTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,17 +287,13 @@ public Collection<Include> getMissingIncludeFiles(File file) { | |
|
||
private boolean isCFile(String filePath) { | ||
for (String pattern : cFilesPatterns) { | ||
String regex = pattern.replace("?", ".?").replace("*", ".*?"); | ||
if (filePath.matches(regex)) { | ||
if (LOG.isTraceEnabled()) { | ||
LOG.trace("Parse '{}' as C file, matches '{}' pattern", filePath, pattern); | ||
} | ||
String patt = pattern.replace("*", ""); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jmecosta
Author
Member
|
||
if (filePath.endsWith(patt)) { | ||
LOG.debug("Parse '{}' as C file, ends in '{}'", filePath, pattern); | ||
return true; | ||
} | ||
} | ||
if (LOG.isTraceEnabled()) { | ||
LOG.trace("Parse '{}' as C++ file", filePath); | ||
} | ||
LOG.debug("Parse '{}' as C++ file", filePath); | ||
return false; | ||
} | ||
|
||
|
public static boolean isFileMatchTargetFilePattern(final File f, final String targetPattern) {
String regex = targetPattern.replace(".", "."); //escape the dot first
regex = regex.replace("?", ".?").replace("", ".");
return f.getName().matches(regex);
}