It is required to have GoGo Protobuf installed:
go get github.com/gogo/protobuf/protoc-gen-gogo
There must be the protoc
tool available in $PATH
, version 3. Grab it from the
official Protocol Buffers releases page (protoc-*.zip
).
Generation of a new plugin skeleton:
hercules generate-plugin -n MyPluginName -o my_plugin
This command creates:
my_plugin/my_plugin_name.go
with the plugin source code. Refer to the docs about LeafPipelineItem.my_plugin/my_plugin_name.proto
which defines the Protocol Buffers scheme of the resultmy_plugin/my_plugin_name.pb.go
is generated frommy_plugin/my_plugin_name.proto
Compilation:
cd my_plugin
make
hercules --plugin my_plugin_name.so --my-plugin-name https://github.com/user/repo
See contrib/plugin_example. It was generated by hercules generate-plugin
and implements code churn analysis through time.
It uses many Hercules features and supports YAML and protobuf output formats.
Generated with hercules --plugin churn_analysis.so --churn https://github.com/src-d/go-git | python3 plot_churn.py --tick-days 14 -