Class TestFileClassifier

java.lang.Object
org.sonar.plugins.python.TestFileClassifier

public class TestFileClassifier extends Object
Heuristic classifier used when sonar.tests is not configured. Determines whether a file should be treated as a test file for rule-execution purposes, without affecting metric computation (which always uses the platform InputFile#type()).
  • Method Details

    • isTestSourceConfigured

      public static boolean isTestSourceConfigured(org.sonar.api.config.Configuration config)
      Returns true when the project configuration explicitly controls which files are test files, making the path-based heuristic unnecessary. Both PythonScanner and SonarQubePythonIndexer use this to decide whether to activate (and cache) the heuristic.