Pronto runner for Golang
Pronto runner for Golang tools
|golint||go get -u golang.org/x/lint/golint|
|gosec||See Install instructions|
|staticcheck||go get -u honnef.co/go/tools/cmd/staticcheck|
|golangci-lint||go get -u github.com/golangci/golangci-lint/cmd/golangci-lint|
In order to configure certain tools for execution it is possible to provide a
.golangtools.yml file in the directory of execution, any parent directory or
It looks as follows:
tools: <tool base command>: enabled: true parameters: '-v' blacklisted_files: '.*\/vendor\/.*'
If a tool is not listed here, it will automatically be enabled.
In order to specifically disable a tool, it has to be listed and
enabled has to be set to
If either of the keys is not provided the default will be assumed.
It is possible to pass specific parameters to the tool, which is executed with
<tool> <parameters> <file_path>.
If is also possible to skip handling specific files by providing a pattern in
'.*\/vendor\/.*' to ignore vendor. It will check every file by default.
Implementing additional tools
It is possible to add additional tools by adding a new class in the
It is expected that it reponds to the following methods:
||Configuration hash from the
||Executes the command and receives the file_path to allow checking only the current file|
||Returns the name/basic command that will be invoked. Is also used for enabling and disabling it via
||Returns true if the tool can be found, e.g. through
||Receives the line returned from the tool for parsing. Returns
It is possible to inherit from
Pronto::GolangTools::Base, in which case only
parse_line need to be implemented.