Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistCppcheckLinter.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Uses Cppcheck to do basic checks in a C++ file. | * Uses Cppcheck to do basic checks in a C++ file. | ||||
| */ | */ | ||||
| final class ArcanistCppcheckLinter extends ArcanistExternalLinter { | final class ArcanistCppcheckLinter extends ArcanistExternalLinter { | ||||
| public function getInfoName() { | public function getInfoName() { | ||||
| return 'Cppcheck'; | return 'Cppcheck'; | ||||
| } | } | ||||
| public function getInfoURI() { | public function getInfoURI() { | ||||
| return 'http://cppcheck.sourceforge.net'; | return 'http://cppcheck.sourceforge.net'; | ||||
| } | } | ||||
| public function getInfoDescription() { | public function getInfoDescription() { | ||||
| return pht('Use `cppcheck` to perform static analysis on C/C++ code.'); | return pht( | ||||
| 'Use `%s` to perform static analysis on C/C++ code.', | |||||
| 'cppcheck'); | |||||
| } | } | ||||
| public function getLinterName() { | public function getLinterName() { | ||||
| return 'cppcheck'; | return 'cppcheck'; | ||||
| } | } | ||||
| public function getLinterConfigurationName() { | public function getLinterConfigurationName() { | ||||
| return 'cppcheck'; | return 'cppcheck'; | ||||
| Show All 18 Lines | public function getVersion() { | ||||
| if (preg_match($regex, $stdout, $matches)) { | if (preg_match($regex, $stdout, $matches)) { | ||||
| return $matches['version']; | return $matches['version']; | ||||
| } else { | } else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
| return pht('Install Cppcheck using `apt-get install cppcheck` or similar.'); | return pht( | ||||
| 'Install Cppcheck using `%s` or similar.', | |||||
| 'apt-get install cppcheck'); | |||||
| } | } | ||||
| protected function getMandatoryFlags() { | protected function getMandatoryFlags() { | ||||
| return array( | return array( | ||||
| '--quiet', | '--quiet', | ||||
| '--inline-suppr', | '--inline-suppr', | ||||
| '--xml', | '--xml', | ||||
| '--xml-version=2', | '--xml-version=2', | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||