|
|
|
@ -16,9 +16,12 @@ import org.sonar.api.batch.rule.Checks; |
|
|
|
|
import org.sonar.api.batch.sensor.Sensor; |
|
|
|
|
import org.sonar.api.batch.sensor.SensorContext; |
|
|
|
|
import org.sonar.api.batch.sensor.SensorDescriptor; |
|
|
|
|
import org.sonar.api.utils.log.Logger; |
|
|
|
|
import org.sonar.api.utils.log.Loggers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class ConfigFileSquidSensor implements Sensor { |
|
|
|
|
private final Logger LOG = Loggers.get(ConfigFileSquidSensor.class); |
|
|
|
|
private final Checks<ConfigCheck> checks; |
|
|
|
|
|
|
|
|
|
private SensorContext context; |
|
|
|
@ -39,6 +42,7 @@ public class ConfigFileSquidSensor implements Sensor { |
|
|
|
|
@Override |
|
|
|
|
public void execute(SensorContext context) { |
|
|
|
|
FilePredicates p = context.fileSystem().predicates(); |
|
|
|
|
LOG.info("ConfigFileSquidSensor FileSystem class is: {}", context.fileSystem().getClass().getName()); |
|
|
|
|
for (InputFile inputFile : context.fileSystem().inputFiles(p.hasLanguages(ConfigurationFileLanguage.KEY))) { |
|
|
|
|
checks.all().forEach(check -> { |
|
|
|
|
check.execute(context, inputFile, checks.ruleKey(check)); |
|
|
|
|