@@ -67,31 +67,33 @@ public final class PythonSensor implements Sensor {
67
67
private final SonarLintCache sonarLintCache ;
68
68
private final AnalysisWarningsWrapper analysisWarnings ;
69
69
private static final Logger LOG = LoggerFactory .getLogger (PythonSensor .class );
70
- static final String UNSET_VERSION_WARNING =
71
- "Your code is analyzed as compatible with all Python 3 versions by default." +
70
+ static final String UNSET_VERSION_WARNING = "Your code is analyzed as compatible with all Python 3 versions by default." +
72
71
" You can get a more precise analysis by setting the exact Python version in your configuration via the parameter \" sonar.python.version\" " ;
73
72
74
73
/**
75
74
* Constructor to be used by pico if neither PythonCustomRuleRepository nor PythonIndexer are to be found and injected.
76
75
*/
77
76
public PythonSensor (FileLinesContextFactory fileLinesContextFactory , CheckFactory checkFactory ,
78
- NoSonarFilter noSonarFilter , AnalysisWarningsWrapper analysisWarnings ) {
77
+ NoSonarFilter noSonarFilter , AnalysisWarningsWrapper analysisWarnings ) {
79
78
this (fileLinesContextFactory , checkFactory , noSonarFilter , null , null , null , analysisWarnings );
80
79
}
81
80
82
81
public PythonSensor (FileLinesContextFactory fileLinesContextFactory , CheckFactory checkFactory , NoSonarFilter noSonarFilter ,
83
- PythonCustomRuleRepository [] customRuleRepositories , AnalysisWarningsWrapper analysisWarnings ) {
82
+ PythonCustomRuleRepository [] customRuleRepositories , AnalysisWarningsWrapper analysisWarnings ) {
84
83
this (fileLinesContextFactory , checkFactory , noSonarFilter , customRuleRepositories , null , null , analysisWarnings );
85
84
}
86
85
87
86
public PythonSensor (FileLinesContextFactory fileLinesContextFactory , CheckFactory checkFactory , NoSonarFilter noSonarFilter ,
88
- PythonIndexer indexer , SonarLintCache sonarLintCache , AnalysisWarningsWrapper analysisWarnings ) {
87
+ PythonIndexer indexer , SonarLintCache sonarLintCache , AnalysisWarningsWrapper analysisWarnings ) {
88
+ // ^^ This constructor implicitly assumes that a PythonIndexer and a SonarLintCache are always available at the same time.
89
+ // In practice, this is currently the case, since both are provided by PythonPlugin under the same conditions.
90
+ // See also PythonPlugin::SonarLintPluginAPIManager::addSonarlintPythonIndexer.
89
91
this (fileLinesContextFactory , checkFactory , noSonarFilter , null , indexer , sonarLintCache , analysisWarnings );
90
92
}
91
93
92
94
public PythonSensor (FileLinesContextFactory fileLinesContextFactory , CheckFactory checkFactory , NoSonarFilter noSonarFilter ,
93
- @ Nullable PythonCustomRuleRepository [] customRuleRepositories , @ Nullable PythonIndexer indexer ,
94
- @ Nullable SonarLintCache sonarLintCache , AnalysisWarningsWrapper analysisWarnings ) {
95
+ @ Nullable PythonCustomRuleRepository [] customRuleRepositories , @ Nullable PythonIndexer indexer ,
96
+ @ Nullable SonarLintCache sonarLintCache , AnalysisWarningsWrapper analysisWarnings ) {
95
97
this .checks = new PythonChecks (checkFactory )
96
98
.addChecks (CheckList .REPOSITORY_KEY , CheckList .getChecks ())
97
99
.addCustomChecks (customRuleRepositories );
0 commit comments