Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ jobs:
golangci:
name: Golang lint
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18.x]
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.40.1
version: v1.45.2
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.18
- id: generate_token
uses: tibdex/github-app-token@v1
with:
Expand Down
11 changes: 11 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
run:
go: 1.18

linters:
# The following are disabled until they support Go 1.18. See:
# https://github.com/golangci/golangci-lint/issues/2649
disable:
- gosimple
- staticcheck
- structcheck
- unused
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
BUILD_DIR := $(PWD)/.build
SHELL := /bin/bash
UNAME := $(shell uname)
ARCH := $(shell uname -m)

GO_SOURCES := $(shell find `echo *` -name '*.go')

ifeq ($(findstring Darwin,$(UNAME)),Darwin)
GOLANG_VERSION := 1.18
GOLANGCI_LINT_VERSION := 1.45.2

ifeq ($(findstring MINGW64_NT,$(UNAME)),MINGW64_NT)
OS := windows
else ifeq ($(findstring Darwin,$(UNAME)),Darwin)
OS := darwin
else ifeq ($(findstring Linux,$(UNAME)),Linux)
OS := linux
else
$(error unsupported OS $(UNAME))
endif
Expand All @@ -31,14 +39,14 @@ ifeq ($(OS),darwin)
$(BUILD_DIR)/go/bin/go:
@echo installing go...
@mkdir -p $(BUILD_DIR)/bin
@cd $(BUILD_DIR) && curl -Ls https://golang.org/dl/go1.17.6.darwin-amd64.tar.gz | tar xz
@cd $(BUILD_DIR) && curl -Ls https://golang.org/dl/go$(GOLANG_VERSION).$(OS)-$(ARCH).tar.gz | tar xz
endif

$(BUILD_DIR)/bin/golangci-lint: $(BUILD_DIR)/bin/activate
@echo 'install golangci-lint...'
@source $(BUILD_DIR)/bin/activate && \
cd $(BUILD_DIR) && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.40.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v$(GOLANGCI_LINT_VERSION)

install-runtime: \
$(BUILD_DIR)/bin/golangci-lint \
Expand All @@ -59,7 +67,6 @@ $(BUILD_DIR)/bin/plz: $(BUILD_DIR)/bin/activate $(GO_SOURCES)
go build -o $(BUILD_DIR)/bin/plz ./cmd/plz

lint: $(BUILD_DIR)/bin/activate $(BUILD_DIR)/bin/golangci-lint
@source $(BUILD_DIR)/bin/activate && \
golangci-lint run $(GO_SOURCES)
@source $(BUILD_DIR)/bin/activate && golangci-lint run

.PHONY: lint
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/bitcomplete/plz-cli/client

go 1.17
go 1.18

require (
github.com/AlecAivazis/survey/v2 v2.3.2
Expand Down