From 31dcab6d7017ac0fdb8422a4f0095c65b0973d81 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Wed, 27 Mar 2024 22:01:18 +0100 Subject: [PATCH] add linter and pre-commit --- .golangci.yml | 3 +++ .pre-commit-config.yaml | 11 +++++++++++ Makefile | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 .golangci.yml create mode 100644 .pre-commit-config.yaml create mode 100644 Makefile diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..297fd59 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,3 @@ +issues: + exclude-dirs: + - contrib diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..44055ab --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/golangci/golangci-lint + rev: v1.57.1 + hooks: + - id: golangci-lint-full diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0614a2d --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +.PHONY: lint +lint: + pre-commit run --all-files golangci-lint-full