diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2023-12-15 14:31:39 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-21 20:02:33 +0000 |
commit | 4d04d1b26abaf409d0c68b97f0cac05e251ff16d (patch) | |
tree | f833caff22fb99819fe5900decdfb8b0666b9799 /plugins/sonar-xoo-plugin/src | |
parent | 32e97e99a805f50e099b16ac55a65703d284979b (diff) | |
download | sonarqube-4d04d1b26abaf409d0c68b97f0cac05e251ff16d.tar.gz sonarqube-4d04d1b26abaf409d0c68b97f0cac05e251ff16d.zip |
SONAR-21195 Refactor file indexing into two distinct steps
Diffstat (limited to 'plugins/sonar-xoo-plugin/src')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java | 4 | ||||
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java | 31 |
2 files changed, 34 insertions, 1 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java index 0255cb07000..d3bebdddc37 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java @@ -27,6 +27,7 @@ import org.sonar.api.resources.Qualifiers; import org.sonar.xoo.coverage.ItCoverageSensor; import org.sonar.xoo.coverage.OverallCoverageSensor; import org.sonar.xoo.coverage.UtCoverageSensor; +import org.sonar.xoo.extensions.XooExcludeFileFilter; import org.sonar.xoo.extensions.XooIssueFilter; import org.sonar.xoo.extensions.XooPostJob; import org.sonar.xoo.extensions.XooProjectBuilder; @@ -204,7 +205,8 @@ public class XooPlugin implements Plugin { XooIssueFilter.class, XooIgnoreCommand.class, SignificantCodeSensor.class, - IssueWithCodeVariantsSensor.class); + IssueWithCodeVariantsSensor.class, + XooExcludeFileFilter.class); if (context.getRuntime().getProduct() != SonarProduct.SONARLINT) { context.addExtension(MeasureSensor.class); diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java new file mode 100644 index 00000000000..011fe1208fc --- /dev/null +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java @@ -0,0 +1,31 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.xoo.extensions; + +import org.sonar.api.batch.fs.InputFile; +import org.sonar.api.batch.fs.InputFileFilter; + +public class XooExcludeFileFilter implements InputFileFilter { + + @Override + public boolean accept(InputFile f) { + return !f.filename().endsWith("_exclude.xoo"); + } +} |