Best_practice
A plugin/cli tool/container/library for automating best practice in a code repository.
It has the following scanners:
- golang, scanner for golang best practice.
And the following output formats:
- Drone build file creation
- best practice report
Example output:
Usage
There are 4 ways to use this project:
Download the Binaries from the release section. Then, you can use it as a cli tool.
./best-practice
Using the container locally
You can use a container locally. This will run it against your current working directory.
docker pull tphoney/best_practice
docker run -it --rm -v $(pwd):/plugin -e PLUGIN_WORKING_DIRECTORY=/plugin tphoney/best_practice
Using it in your drone build
Below is an example .drone.yml that uses this plugin.
kind: pipeline
name: default
steps:
- name: run tphoney/best_practice plugin
image: tphoney/best_practice
pull: if-not-exists
Using it as a library
Have a look at the calls in `plugin\plugin.go
Developer notes
Building
Build the plugin binaries:
scripts/build.sh
Build the plugin image:
docker build -t tphoney/best_practice -f docker/Dockerfile .