Search in sources :

Example 1 with Check

use of org.sonar.xoo.checks.Check in project sonarqube by SonarSource.

the class ChecksSensor method execute.

@Override
public void execute(SensorContext context) {
    Checks<Check> checks = checkFactory.create(XooRulesDefinition.XOO_REPOSITORY);
    checks.addAnnotatedChecks((Object[]) Check.ALL);
    FilePredicates p = context.fileSystem().predicates();
    for (InputFile file : context.fileSystem().inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(Type.MAIN)))) {
        for (Check check : checks.all()) {
            check.execute(context, file, checks.ruleKey(check));
        }
    }
}
Also used : FilePredicates(org.sonar.api.batch.fs.FilePredicates) Check(org.sonar.xoo.checks.Check) InputFile(org.sonar.api.batch.fs.InputFile)

Aggregations

FilePredicates (org.sonar.api.batch.fs.FilePredicates)1 InputFile (org.sonar.api.batch.fs.InputFile)1 Check (org.sonar.xoo.checks.Check)1