Best_practice
A plugin/cli tool/container/library for automating best practice in a code repository. For example:
- Build a drone yaml file based on the technologies in the repo
- Give general programming language specific recommendations
- Recommend other Harness products based on your project
It has the following scanners:
- Drone scanner, analyses your build file
- golang scanner, for best practice
- Java scanner, for best practice
- Javascript scanner, for best practice
And the following output formats:
- Best practice report
- Drone build file creation
- Harness product recommendations.
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 .