From 912d7ead2326d3066af74698931f5600f7be09f2 Mon Sep 17 00:00:00 2001 From: RouxAntoine <antoinroux@hotmail.fr> Date: Sat, 30 Dec 2023 00:35:02 +0100 Subject: [PATCH] feature: golangci configuration --- .golangci.yml | 26 ++++++++++++++++++++++++++ Makefile | 3 +++ cmd/main.go | 2 -- doc.go | 2 ++ docs/README.md | 8 ++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .golangci.yml create mode 100644 doc.go diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..62f836f --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,26 @@ +linters: + enable: + - errcheck + - errorlint + - gocritic + - gosec + - gosimple + - govet + - gci + - misspell + - nonamedreturns + - staticcheck + - unconvert + - unparam + - unused + - whitespace + +linters-settings: + gci: + sections: + - standard + - default + - prefix(antoine-roux.tk/projects/go) + +run: + timeout: 5m diff --git a/Makefile b/Makefile index 74138a1..629b3f4 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,6 @@ build: run: @chmod +x ./out/main ./out/main + +ci: + golangci-lint run --fix diff --git a/cmd/main.go b/cmd/main.go index 1924992..dcec099 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -3,7 +3,5 @@ package main import "fmt" func main() { - fmt.Println("Hello world !") - } diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..fdb6b5c --- /dev/null +++ b/doc.go @@ -0,0 +1,2 @@ +// Package gotemplate is a sample project for bootstrapping golang project. +package gotemplate diff --git a/docs/README.md b/docs/README.md index 2508403..d09deef 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1 +1,9 @@ # documentations + +local : + +linter required + +```shell +$ brew install golangci-lint +```