Drone plugin to run pre-commit hooks
Go to file
Ian Fijolek 9b7047913a
All checks were successful
continuous-integration/drone/push Build is passing
Change golangci-lint install dir
2021-02-02 14:34:47 -08:00
scripts Change golangci-lint install dir 2021-02-02 14:34:47 -08:00
tests Add tests 2020-09-08 10:14:06 -07:00
.drone.yml Add personal image with hadolint 2020-09-08 13:20:54 -07:00
.pre-commit-config.yaml Add tests 2020-09-08 10:14:06 -07:00
Dockerfile Initial commit 2020-09-08 10:02:15 -07:00
Dockerfile.personal Add golangci-lint to personal image 2021-02-02 13:59:15 -08:00
LICENSE Initial commit 2020-09-08 10:02:15 -07:00
Makefile Add personal image with hadolint 2020-09-08 13:20:54 -07:00
Readme.md Add personal image with hadolint 2020-09-08 13:20:54 -07:00

drone-pre-commit

A pre-commit plugin, for the drone.io project, which allows you to run pre-commit checks as part of your build steps.

Examples

An example configuration would be as follows:

steps:
  - name: run checks
    image: iamthefij/drone-pre-commit:latest

Or, if you have additional dependencies to install

steps:
  - name: run ruby dependent checks
    image: iamthefij/drone-pre-commit:latest
    commands:
      - apt-get update
      - apt-get install -y --no-install-recommends ruby
      # You must run your own pre-commit command at the end
      - pre-commit run --all-files

Personal image

A second image is also built for my personal use, but it may be useful to you as well. This image includes the following dependencies:

  • hadolint

To Do

So far this is basic and unopinionated. Either this will become very personal as I tack on dependencies for the hooks I often use, or it'll become complicated as I add args for everything and build out many tags. I think I'll probbably try to provide some reasonable base image that can then be extended in a new image or as part of one's build pipeline.