Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/constraint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
if: contains(fromJSON('["pull_request"]'), github.event_name)
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
- name: run e2e
Expand All @@ -33,13 +33,13 @@ jobs:
runs-on: windows-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'
- name: install K3d
shell: powershell
run: |
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go 1.22
uses: actions/setup-go@v2
- name: Set up Go 1.26
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'
- name: Running go tests with coverage
env:
GO111MODULE: on
Expand All @@ -33,32 +33,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go 1.22
uses: actions/setup-go@v2
- name: Set up Go 1.26
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v9
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.56.2
version: v2.14.0
Publish: # Pack and publish image to Docker Hub and GitHub Release
runs-on: ubuntu-latest
needs: [Test, Lint]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'
- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v7
with:
node-version: '18'
- name: Install npm packages and build UI
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go 1.22
uses: actions/setup-go@v2
- name: Set up Go 1.26
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'

- run: go build ./...
- run: go vet ./...
Expand All @@ -30,7 +30,7 @@ jobs:
GO111MODULE: on
run: make cover
- name: Send coverage
uses: shogo82148/actions-goveralls@v1.8.0
uses: shogo82148/actions-goveralls@v1.11.2
with:
path-to-profile: coverage.out

Expand All @@ -39,15 +39,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go 1.22
uses: actions/setup-go@v2
- name: Set up Go 1.26
uses: actions/setup-go@v7
with:
go-version: 1.22
go-version: '1.26'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v9
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.56.2
version: v2.14.0
111 changes: 74 additions & 37 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
# This file contains all available configuration options
# with their default values.
# For complete .golangci.yml configuration, reference: https://golangci-lint.run/usage/configuration/#config-file
# golangci-lint v2 configuration.
# For the full reference, see: https://golangci-lint.run/usage/configuration/
version: "2"

# options for analysis running
run:
timeout: 10m

linters:
disable-all: true
default: none
enable: # please keep this alphabetized
# Don't use soon to deprecated[1] linters that lead to false
# https://github.com/golangci/golangci-lint/issues/1841
# - deadcode
# - structcheck
# - varcheck
- ineffassign
- staticcheck
- unused
- gosimple
- govet
- gofumpt
# gosimple and stylecheck are part of staticcheck since golangci-lint v2.
# exportloopref was removed: Go 1.22 loop variable semantics make it obsolete.
# typecheck is always on and can no longer be listed.
- bodyclose
# - depguard
- dogsled
- dupl
- exportloopref
- gocritic
# - misspell
- govet
- ineffassign
# - misspell
- nolintlint
- prealloc
- predeclared
- stylecheck
- staticcheck
- tparallel
- typecheck
- unconvert
- unused
- whitespace
# - depguard
# - wsl
# - revive
# - unparam
Expand All @@ -44,20 +36,65 @@ linters:
# - thelper
# - goconst
# - errcheck
settings:
govet:
disable:
# New in recent Go releases; not enabled under golangci-lint v1.
- inline
staticcheck:
# Default checks, minus the QF* quick fixes that staticcheck gained when
# gosimple and stylecheck were merged into it in golangci-lint v2.
checks:
- all
- -ST1000
- -ST1003
- -ST1016
- -ST1020
- -ST1021
- -ST1022
- -QF*
exclusions:
generated: lax
# Keep the exclusions and skipped directories that golangci-lint v1
# applied by default.
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# Newer prealloc versions also flag slices that start from a literal.
# Allocation hints are not worth the churn in table-driven tests.
- path: _test\.go$
linters:
- prealloc
- path: (.+)\.go$
text: "G306: Expect WriteFile permissions to be 0600 or less"
- path: (.+)\.go$
text: "ST1018: string literal contains Unicode control characters, consider using escape sequences instead"
- path: (.+)\.go$
text: "ifElseChain: rewrite if-else to switch statement"
- path: (.+)\.go$
text: "S1000: should use for range instead of for { select {} }"
- path: (.+)\.go$
text: "SA4004: the surrounding loop is unconditionally terminated"
- path: (.+)\.go$
text: "copylocks: call of c\\.Post copies lock value: kcl-lang\\.io/kcl-go/pkg/spec/gpyrpc\\.Ping_Args contains google\\.golang\\.org/protobuf/internal/impl\\.MessageState contains sync\\.Mutex"
paths:
- (^|/)third_party($|/)
- (^|/)builtin($|/)
- (^|/)examples($|/)

linters-settings:
gofumpt:
# Select the Go version to target. The default is `1.15`.
lang-version: "1.22"
# Choose whether or not to use the extra rules that are disabled
# by default
extra-rules: false

issues:
exclude:
- "G306: Expect WriteFile permissions to be 0600 or less"
- "ST1018: string literal contains Unicode control characters, consider using escape sequences instead"
- "ifElseChain: rewrite if-else to switch statement"
- "S1000: should use for range instead of for { select {} }"
- "SA4004: the surrounding loop is unconditionally terminated"
- "copylocks: call of c\\.Post copies lock value: kcl-lang\\.io/kcl-go/pkg/spec/gpyrpc\\.Ping_Args contains google\\.golang\\.org/protobuf/internal/impl\\.MessageState contains sync\\.Mutex"
formatters:
enable:
- gofumpt
settings:
gofumpt:
# The target Go version is read from go.mod.
extra-rules: false
exclusions:
generated: lax
paths:
- (^|/)third_party($|/)
- (^|/)builtin($|/)
- (^|/)examples($|/)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /src/ui
RUN npm install
RUN npm run build

FROM golang:1.22 AS build
FROM golang:1.26 AS build
COPY / /src
COPY --from=portal-builder /src/ui/build /src/ui/build
WORKDIR /src
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN_IN_DOCKER+=-w /root/kusion ${KCLVM_BUILDER}
GOFORMATER ?= gofumpt
GOFORMATER_VERSION ?= v0.2.0
GOLINTER ?= golangci-lint
GOLINTER_VERSION ?= v1.56.2
GOLINTER_VERSION ?= v2.14.0
COVER_FILE ?= coverage.out
SOURCE_PATHS ?= ./pkg/...

Expand Down Expand Up @@ -63,11 +63,11 @@ format: ## Format source code
@for path in $(SOURCE_PATHS); do ${GOFORMATER} -l -w -e `echo $${path} | cut -b 3- | rev | cut -b 5- | rev`; done;

lint: ## Lint, will not fix but sets exit code on error
@which $(GOLINTER) > /dev/null || (echo "Installing $(GOLINTER)@$(GOLINTER_VERSION) ..."; go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLINTER_VERSION) && echo -e "Installation complete!\n")
@which $(GOLINTER) > /dev/null || (echo "Installing $(GOLINTER)@$(GOLINTER_VERSION) ..."; go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLINTER_VERSION) && echo -e "Installation complete!\n")
$(GOLINTER) run --timeout=10m $(SOURCE_PATHS)

lint-fix: ## Lint, will try to fix errors and modify code
@which $(GOLINTER) > /dev/null || (echo "Installing $(GOLINTER)@$(GOLINTER_VERSION) ..."; go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLINTER_VERSION) && echo -e "Installation complete!\n")
@which $(GOLINTER) > /dev/null || (echo "Installing $(GOLINTER)@$(GOLINTER_VERSION) ..."; go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLINTER_VERSION) && echo -e "Installation complete!\n")
$(GOLINTER) run --timeout=10m $(SOURCE_PATHS) --fix

doc: ## Start the documentation server with godoc
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/aws/aws-sdk-go-v2/config v1.25.8
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.24.2
github.com/blang/semver/v4 v4.0.0
github.com/bytedance/mockey v1.2.10
github.com/bytedance/mockey v1.4.6
github.com/chai2010/gettext-go v1.0.2
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/djherbis/times v1.5.0
Expand Down Expand Up @@ -239,7 +239,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/gopherjs/gopherjs v1.12.80 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosuri/uilive v0.0.4 // indirect
Expand Down Expand Up @@ -307,8 +307,8 @@ require (
github.com/satori/go.uuid v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.3
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/spf13/pflag v1.0.5
github.com/swaggo/files v1.0.1 // indirect
github.com/thoas/go-funk v0.9.3 // indirect
Expand Down
Loading
Loading