diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -89,6 +89,8 @@ 'ArcanistGoLintLinterTestCase' => 'lint/linter/__tests__/ArcanistGoLintLinterTestCase.php', 'ArcanistGoTestResultParser' => 'unit/parser/ArcanistGoTestResultParser.php', 'ArcanistGoTestResultParserTestCase' => 'unit/parser/__tests__/ArcanistGoTestResultParserTestCase.php', + 'ArcanistGoVetLinter' => 'lint/linter/ArcanistGovetLinter.php', + 'ArcanistGoVetLinterTestCase' => 'lint/linter/__tests__/ArcanistGovetLinterTestCase.php', 'ArcanistHLintLinter' => 'lint/linter/ArcanistHLintLinter.php', 'ArcanistHLintLinterTestCase' => 'lint/linter/__tests__/ArcanistHLintLinterTestCase.php', 'ArcanistHelpWorkflow' => 'workflow/ArcanistHelpWorkflow.php', @@ -288,6 +290,8 @@ 'ArcanistGoLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistGoTestResultParser' => 'ArcanistTestResultParser', 'ArcanistGoTestResultParserTestCase' => 'ArcanistTestCase', + 'ArcanistGoVetLinter' => 'ArcanistExternalLinter', + 'ArcanistGoVetLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistHLintLinter' => 'ArcanistExternalLinter', 'ArcanistHLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistHelpWorkflow' => 'ArcanistWorkflow', diff --git a/src/lint/linter/ArcanistGoVetLinter.php b/src/lint/linter/ArcanistGoVetLinter.php new file mode 100644 --- /dev/null +++ b/src/lint/linter/ArcanistGoVetLinter.php @@ -0,0 +1,67 @@ +setPath($path); + $message->setLine($matches[1]); + $message->setCode($this->getLinterName()); + $message->setDescription(ucfirst(trim($matches[2]))); + $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); + + $messages[] = $message; + } + } + + return $messages; + } + +} diff --git a/src/lint/linter/__tests__/ArcanistGoVetLinterTestCase.php b/src/lint/linter/__tests__/ArcanistGoVetLinterTestCase.php new file mode 100644 --- /dev/null +++ b/src/lint/linter/__tests__/ArcanistGoVetLinterTestCase.php @@ -0,0 +1,10 @@ +executeTestsInDirectory(dirname(__FILE__).'/govet/'); + } + +} diff --git a/src/lint/linter/__tests__/govet/fmt.lint-test b/src/lint/linter/__tests__/govet/fmt.lint-test new file mode 100644 --- /dev/null +++ b/src/lint/linter/__tests__/govet/fmt.lint-test @@ -0,0 +1,9 @@ +package main + +import "fmt" + +func main() { + fmt.Println("%d", 1) +} +~~~~~~~~~~ +warning:6