Skip to content

Commit

Permalink
Bump go, dependencies, improve linting a lot (#29)
Browse files Browse the repository at this point in the history
* Bump go, dependencies, improve linting a lot

Signed-off-by: Stavros Foteinopoulos <[email protected]>

* Fix pagerduty issues

Signed-off-by: Stavros Foteinopoulos <[email protected]>

---------

Signed-off-by: Stavros Foteinopoulos <[email protected]>
  • Loading branch information
stafot authored Nov 1, 2024
1 parent b327574 commit 2786bba
Show file tree
Hide file tree
Showing 85 changed files with 2,137 additions and 2,177 deletions.
23 changes: 20 additions & 3 deletions account-alerts/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@

run:
skip-dirs-use-default: false

linters:
disable-all: true
enable:
- revive
- gocyclo
- misspell
- gofmt
- gosimple
- govet
- ineffassign
- predeclared
- staticcheck
- unconvert
- unused

gocyclo:
min-complexity: 15

issues:
exclude-use-default: false
exclude-dirs-use-default: false
max-issues-per-linter: 0
max-same-issues: 0

linters-settings:
gofmt:
simplify: true
govet:
enable-all: true
disable:
- fieldalignment
- atomicalign
10 changes: 7 additions & 3 deletions account-alerts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PACKAGE ?= $(HANDLER)
GOPATH ?= $(HOME)/go
GOOS ?= linux
GOARCH ?= amd64
GOLANGCILINT_VER := v1.61.0

WORKDIR = $(CURDIR:$(GOPATH)%=/go%)
ifeq ($(WORKDIR),$(CURDIR))
Expand All @@ -23,7 +24,7 @@ update-modules:
go get -u ./...
go mod tidy

.PHONY: fmt

## fmt: Run go fmt on codebase
fmt:
@echo Checking if code is formatted
Expand All @@ -40,7 +41,6 @@ fmt:
fi; \
echo "gofmt success"; \

.PHONY: lint
## lint: Run golangci-lint on codebase
lint:
@echo "Linting..."
Expand All @@ -56,4 +56,8 @@ clean:
@echo "Cleaning up..."
@rm -rf $(HANDLER) $(PACKAGE).zip

.PHONY: all build pack clean update-modules
check-style: lint fmt

lint-install:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCILINT_VER)
.PHONY: all build pack clean update-modules lint fmt check-style lint-install
66 changes: 30 additions & 36 deletions account-alerts/go.mod
Original file line number Diff line number Diff line change
@@ -1,58 +1,52 @@
module github.com/mattermost/mattermost-cloud-lambdas/account-mattermost-alerts

go 1.21
go 1.23

require (
github.com/aws/aws-lambda-go v1.41.0
github.com/aws/aws-sdk-go v1.47.8
github.com/mattermost/mattermost-server/v6 v6.0.0-20220725064608-2c1ffb1d8d42
github.com/aws/aws-lambda-go v1.47.0
github.com/aws/aws-sdk-go v1.55.5
github.com/mattermost/mattermost/server/public v0.1.7
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
k8s.io/client-go v0.28.3
)

require (
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/dyatlov/go-opengraph/opengraph v0.0.0-20220524092352-606d7b1e5f8a // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/graph-gophers/graphql-go v1.5.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.2 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 // indirect
github.com/mattermost/ldap v0.0.0-20201202150706-ee0e6284187d // indirect
github.com/mattermost/logr/v2 v2.0.18 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.63 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mattermost/ldap v0.0.0-20231116144001-0f480c025956 // indirect
github.com/mattermost/logr/v2 v2.0.21 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/tinylib/msgp v1.1.9 // indirect
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/tinylib/msgp v1.2.4 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/wiggin77/merror v1.0.5 // indirect
github.com/wiggin77/srslog v1.0.1 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.28.3 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Loading

0 comments on commit 2786bba

Please sign in to comment.