Skip to content

Commit

Permalink
feat: add some custom linters to golangci-lint (#3)
Browse files Browse the repository at this point in the history
Automate a lot of recurring errors.
  • Loading branch information
karmingc committed Jul 24, 2023
1 parent 3af2f71 commit 9092077
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
linters:
enable:
- errname
- errorlint
- exhaustive
- exhaustruct
- gocheckcompilerdirectives
- gochecknoglobals
- goconst
- goerr113
- gosec
- godot
- misspell
- stylecheck
- tagliatelle
- unparam
- revive
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.PHONE: lint
lint: ## Lint the code with golangci-lint
docker run --rm -v $$(pwd):/app -w /app golangci/golangci-lint golangci-lint run -v

.PHONY: changelog
changelog: ## Generates a changelog with the template under ./changelog/config.yaml.
go run github.com/aaronfriel/[email protected] create
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: patch
scope: feat/developer experience,tests
description: Add custom linters to golangci-lint
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package main

import "fmt"
import (
"fmt"
)

func main() {
fmt.Println("Hello, welcome to go-template!")

}

0 comments on commit 9092077

Please sign in to comment.