我正在尝试从命令行运行sonarlint(2.1.0.566),以便分析c ++代码但没有成功。在Eclipse中使用sonarlint插件也能很好地工作。此外,我能够在我们的sonarqube服务器上看到分析结果。 我运行以下命令:
sonarlint --src "src/*.cpp" -X
我得到了以下日志:
DEBUG: Plugins:
DEBUG: * C / C++ / Objective-C 4.4.0.6266 (cpp)
DEBUG: * Python 1.6 (python)
DEBUG: * Java 4.4.0.8066 (java)
DEBUG: * PHP 2.9.1.1705 (php)
DEBUG: * JavaScript 2.19.0.3866 (javascript)
DEBUG: * PL/SQL 2.8 (plsql)
DEBUG: * Swift 2.0.0.1127 (swift)
这很好,似乎我们有一个c ++插件。下一行也很好:
DEBUG: Available languages:
DEBUG: * C => "c"
DEBUG: * C++ => "cpp"
DEBUG: * Objective-C => "objc"
DEBUG: * Python => "py"
DEBUG: * Java => "java"
DEBUG: * PHP => "php"
DEBUG: * JavaScript => "js"
DEBUG: * PL/SQL => "plsql"
DEBUG: * Swift => "swift"
然而以下几行令人困惑:
DEBUG: Start analysis
DEBUG: Declared extensions of language C were converted to c: file:**/*.disabled
DEBUG: Declared extensions of language C++ were converted to cpp: file:**/*.disabled
DEBUG: Declared extensions of language Objective-C were converted to objc: file:**/*.disabled
DEBUG: Declared extensions of language Python were converted to py: file:**/*.py
DEBUG: Declared extensions of language Java were converted to java: file:**/*.java,file:**/*.jav
DEBUG: Declared extensions of language PHP were converted to php: file:**/*.php,file:**/*.php3,file:**/*.php4,file:**/*.php5,file:**/*.phtml,file:**/*.inc
DEBUG: Declared extensions of language JavaScript were converted to js: file:**/*.js
DEBUG: Declared extensions of language PL/SQL were converted to plsql: file:**/*.sql,file:**/*.pks,file:**/*.pkb
DEBUG: Declared extensions of language Swift were converted to swift: file:**/*.swift
...
INFO: 34 files indexed
DEBUG: 'C' skipped because there is no related file in current project
DEBUG: 'CPP' skipped because there is no related file in current project
DEBUG: 'Objective-C' skipped because there is no related file in current project
DEBUG: 'Python Squid Sensor' skipped because there is no related file in current project
DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
DEBUG: 'PHP sensor' skipped because there is no related file in current project
DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
DEBUG: 'Swift Squid Sensor' skipped because there is no related file in current project
为什么禁用c ++扩展? 我该如何启用它?