Skip to content

Commit

Permalink
fix: brew setup, golangci and make commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsm-dev committed Oct 4, 2022
1 parent 1dd5d05 commit 7dd5f11
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ run:
linters:
enable-all: false
enable:
- bodyclose
- errcheck
- gosimple
- govet
Expand All @@ -18,6 +19,7 @@ linters:
- typecheck
- stylecheck
- unused
- nilerr
- misspell
- whitespace
disable:
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ brews:
homepage: "https://github.com/ci-monk/loli"
description: "Install Loli CLI with brew and find animes passing images"
license: "MIT"
install: |
bin.install "loli"
release:
github:
owner: ci-monk
Expand Down
33 changes: 30 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ endif
GO := go
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif

GOLANGCILINT_VERSION ?= v1.46.2

# NOTE: '-race' requires cgo; enable cgo by setting CGO_ENABLED=1
BUILD_FLAG := -race
Expand Down Expand Up @@ -68,12 +75,15 @@ help:
@echo "make setup"
@echo "make build"
@echo "make install"
@echo "make lint"
@echo "make test"
@echo "make misspell"
@echo "make clean"
@echo "make lint"
@echo "make verify-goreleaser"
@echo "make snapshot"
@echo "make release"
@echo ""



##################################################
# GOLANG SHORTCUTS
##################################################
Expand Down Expand Up @@ -105,6 +115,23 @@ clean:
rm -rf ./bin/* ./vendor ./dist *.tar.gz
@echo ""

golangci:
ifeq (, $(shell which golangci-lint))
@{ \
set -e ;\
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
echo 'Install succeed' ;\
}
GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif

.PHONY: lint
lint: golangci
$(GOLANGCILINT) run ./...

.PHONY: verify-goreleaser
verify-goreleaser:
ifeq (, $(shell which goreleaser))
Expand Down
1 change: 1 addition & 0 deletions internal/log/logger.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck
package log

func applyOptions(opts []Option) *options {
Expand Down

0 comments on commit 7dd5f11

Please sign in to comment.