Skip to content

Commit

Permalink
Add plugins folder placeholder in inspections.yml exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
MeGysssTaa committed Feb 8, 2020
1 parent addb6b5 commit 6f39739
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,27 @@ public void analyzeJar(File inputJar) {

if (InspectionsConfig.getYaml().getBoolean(configName + ".enabled", true)) {
try {
String inputJarPath = inputJar.getAbsolutePath();
String pluginsFolderPath = inputJar.getParentFile().getPath();

List<String> exclusions = InspectionsConfig.getYaml().
getStringList(configName + ".exclusions");

if (exclusions.contains(inputJar.getAbsolutePath())) {
KeikoPluginInspector.debug(
"JAR %s is excluded from analysis %s in config.", inputJarName, name);
continue;
boolean excluded = false;

for (String exclusion : exclusions) {
if (exclusion.replace("{plugins_folder}", pluginsFolderPath).equals(inputJarPath)) {
KeikoPluginInspector.debug(
"JAR %s is excluded from analysis %s in config.", inputJarName, name);

excluded = true;
break;
}
}

if (excluded)
continue;

Constructor<StaticAnalysis> constructor = inspectionClass.
getDeclaredConstructor(String.class, String.class, Collection.class);
constructor.setAccessible(true);
Expand Down

0 comments on commit 6f39739

Please sign in to comment.