From 21233082279cb13e7c049d8c9d784de764bf9284 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 28 Jan 2022 09:42:12 -0800 Subject: [PATCH] Add pre-commit hooks --- .pre-commit-config.yaml | 15 +++++++++++++++ Makefile | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b984afa --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-added-large-files + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-merge-conflict + - repo: git://github.com/dnephin/pre-commit-golang + rev: v0.4.0 + hooks: + - id: go-fmt + - id: go-imports + - id: golangci-lint diff --git a/Makefile b/Makefile index 6dab0a8..6f42a04 100644 --- a/Makefile +++ b/Makefile @@ -22,3 +22,7 @@ install: $(BIN) .PHONY: set-default set-default: xdg-settings set default-web-browser browserRuler.desktop + +.PHONY: install-hooks +install-hooks: + pre-commit install --install-hooks