Skip to content
Permalink
Browse files

Add precommit hooks (#136)

* add pre-commit hooks.

* uses the fantastic pre-commit project to manage hooks:
  https://github.com/pre-commit/pre-commit
* introduces a Makefile to facilitate installation and initialisation
  of pre-commit for new devs.
* adds the following go hooks: golangci-lint.
* adds a few general sanity check hooks.

* readme: explain how to install pre-commit hooks.
  • Loading branch information
raulk committed Nov 7, 2019
1 parent 860b1fc commit b062d050785e6e7afdd40a61a3b3f88cab36523f
Showing with 30 additions and 1 deletion.
  1. +13 −0 .pre-commit-config.yaml
  2. +3 −0 Makefile
  3. +14 −1 README.md
@@ -0,0 +1,13 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/golangci/golangci-lint
rev: v1.21.0
hooks:
- id: golangci-lint
@@ -0,0 +1,3 @@
init:
pip install pre-commit --upgrade
pre-commit install --install-hooks
@@ -84,7 +84,20 @@ Refer to the [specification](docs/SPEC.md) document.

## Contributing & Testing

We kindly ask you to read through the SPEC first and give this project a run first in your local machine. It is a fast moving project at the moment and it might require some tinkering and experimentation to compesate the lack of documentation.
We kindly ask you to read through the [SPEC](docs/SPEC.md) first and give this
project a run first in your local machine. It is a fast moving project at the
moment, and it might require some tinkering and experimentation to compensate
for the lack of documentation.

If you plan to contribute code, make sure to install the
[pre-commit](https://github.com/pre-commit/pre-commit) tool, which manages our
pre-commit hooks for things like linters, go fmt, go vet, etc.

We provide a `Makefile` rule to facilitate the setup:

```sh
$ make init
```

### Setup

0 comments on commit b062d05

Please sign in to comment.
You can’t perform that action at this time.