github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/_example/plugin/README.md (about)

     1  # Plugin Example
     2  
     3  ### Build
     4  
     5  ```bash
     6  go build -o plugin_example main.go
     7  ```
     8  
     9  NOTE: protolint plugin is backed by [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin), not the [plugin](https://golang.org/pkg/plugin/) standard library.
    10  
    11  Therefore, you can build the plugin just as a normal Go main package.
    12  
    13  ### Run
    14  
    15  ```bash
    16  protolint -plugin ./plugin_example /path/to/files
    17  
    18  # Or you can pass some flags to your plugin:
    19  protolint -plugin "./plugin_example -go_style=false" /path/to/files
    20  
    21  # You can see that your plugin is loaded correctly.
    22  protolint list -plugin ./plugin_example
    23  ```
    24  
    25  NOTE: `sh` must be in your PATH.
    26  
    27  NOTE2: Even when you specify the plugin, the configuration defined in `.protolint.yaml` can stop your plugin from working. Check the yaml when your plugin doesn't appear to be working. See https://github.com/yoheimuta/protolint/issues/260 in detail.