Skip to content

Commit

Permalink
add golang linter to git ignore. dont rely on os when installing lint…
Browse files Browse the repository at this point in the history
…er (#5)

* add golang linter to git ignore. dont rely on os when installing linter

* added -- to sh cmd for safety
  • Loading branch information
tigh-latte authored Jul 23, 2021
1 parent 111ea53 commit 0e59664
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# linter binary
golangci-lint

# Notes
todo.md

# Distribution directory for releases
dist

# Converage
coverage.txt
coverage.txt
14 changes: 4 additions & 10 deletions .make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@ install-go: ## Install the application (Using Native Go)
@go install $(GIT_DOMAIN)/$(REPO_OWNER)/$(REPO_NAME)

lint: ## Run the golangci-lint application (install if not found)
@#Travis (has sudo)
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.33.0 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
@#AWS CodePipeline
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.33.0; fi;
@#Github Actions
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.33.0; fi;
@#Brew - MacOS
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then brew install golangci-lint; fi;
@echo "downloading golangci-lint..."
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- v1.33.0
@echo "running golangci-lint..."
@golangci-lint run
@GOGC=20 ./bin/golangci-lint run

test: ## Runs vet, lint and ALL tests
@$(MAKE) lint
Expand Down Expand Up @@ -97,4 +91,4 @@ update-linter: ## Update the golangci-lint package (macOS only)

vet: ## Run the Go vet application
@echo "running go vet..."
@go vet -v ./...
@go vet -v ./...

0 comments on commit 0e59664

Please sign in to comment.