Skip to content

Commit 1295b5f

Browse files
authored
force golangci to recent commit to solve macos issue (#1733)
Some MacOS users (@jecepeda and I for example) can not run `make check-style` since golangci is broken after Ventura upgrade. Apparently the native diff is not compatible with some time format used by `gofmt diff`. More info golangci/golangci-lint#3402, golangci/golangci-lint#3087 and golangci/golangci-lint#3375 The issue has been fixed at master for more than a month but there's been no release (since October 22nd). It's not very nice to pin the commit version of the package but is a working solution until golangci release 10.50.2 version. Additionally, the list of linters has been updated, removing deprecated ones and fixing a new error that appeared.
1 parent 3b44082 commit 1295b5f

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ run:
1212
linters:
1313
disable-all: true
1414
enable:
15-
- deadcode
1615
- errcheck
1716
- gofmt
1817
- goimports
@@ -25,9 +24,6 @@ linters:
2524
- staticcheck
2625
- unconvert
2726
- unused
28-
- varcheck
29-
# disabled until is compatible with go1.18 https://github.com/golangci/golangci-lint/issues/2649
30-
# - structcheck
3127

3228
linters-settings:
3329
gofmt:

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ endif
7575
cd tests-e2e && npm run fix
7676

7777

78+
## Check & install golangci version
79+
# Pinned version to commit until 10.2 is released since some macos version have problems
80+
# with the native diff tools used by typecheck (gometalinter problem)
7881
.PHONY: check-golangci
7982
check-golangci:
8083
ifneq ($(HAS_SERVER),)
8184
@echo Ckecking golangci-lint
82-
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2
85+
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@8f6de2c65895749d9ced401cde189d80f41617a0
8386
endif
8487

8588

server/app/playbook_run_service.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,9 +3618,7 @@ func (s *PlaybookRunServiceImpl) doActions(taskActions []Action, runID string, u
36183618
}
36193619
if a.Payload.Enabled {
36203620
if err := s.ModifyCheckedState(runID, userID, ChecklistItemStateClosed, checklistNum, itemNum); err != nil {
3621-
if err != nil {
3622-
return errors.Wrapf(err, "can't mark item as done")
3623-
}
3621+
return errors.Wrapf(err, "can't mark item as done")
36243622
}
36253623
}
36263624
}

0 commit comments

Comments
 (0)