Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump kcl lib to 0.8.0 stable #56

Merged
merged 2 commits into from
Mar 6, 2024
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0-beta.1
0.8.0
27 changes: 26 additions & 1 deletion cmd/kcl/commands/vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
package cmd

import (
"errors"
"fmt"
"io"
"os"

"github.com/spf13/cobra"
"kcl-lang.io/cli/pkg/fs"
"kcl-lang.io/kcl-go/pkg/service"
"kcl-lang.io/kcl-go/pkg/spec/gpyrpc"
"kcl-lang.io/kcl-go/pkg/tools/validate"
)

Expand Down Expand Up @@ -76,7 +79,7 @@ func doValidate(dataFile, codeFile string, o *validate.ValidateOptions) error {
return err
}
for _, dataFile := range dataFiles {
ok, err = validate.Validate(dataFile, codeFile, o)
ok, err = validateFile(dataFile, codeFile, o)
if err != nil {
return err
}
Expand All @@ -87,3 +90,25 @@ func doValidate(dataFile, codeFile string, o *validate.ValidateOptions) error {
}
return nil
}

func validateFile(dataFile, codeFile string, opts *validate.ValidateOptions) (ok bool, err error) {
if opts == nil {
opts = &validate.ValidateOptions{}
}
client := service.NewKclvmServiceClient()
resp, err := client.ValidateCode(&gpyrpc.ValidateCode_Args{
Datafile: dataFile,
File: codeFile,
Schema: opts.Schema,
AttributeName: opts.AttributeName,
Format: opts.Format,
})
if err != nil {
return false, err
}
var e error = nil
if resp.ErrMessage != "" {
e = errors.New(resp.ErrMessage)
}
return resp.Success, e
}
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/spf13/cobra v1.8.0
kcl-lang.io/kcl-go v0.8.0-beta.1
kcl-lang.io/kcl-go v0.8.0
kcl-lang.io/kcl-openapi v0.5.5
kcl-lang.io/kcl-playground v0.5.1
kcl-lang.io/kpm v0.8.0-beta.1
kcl-lang.io/kpm v0.8.0
)

require (
Expand Down Expand Up @@ -160,7 +160,7 @@ require (
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
kcl-lang.io/lib v0.8.0-beta.1 // indirect
kcl-lang.io/lib v0.8.0 // indirect
oras.land/oras-go v1.2.3 // indirect
oras.land/oras-go/v2 v2.3.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/thoas/go-funk v0.9.3 h1:7+nAEx3kn5ZJcnDm2Bh23N2yOtweO14bi//dvRtgLpw=
github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
Expand Down Expand Up @@ -1353,16 +1353,16 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kcl-lang.io/kcl-go v0.8.0-beta.1 h1:Bw4gnW0zhvmbtTmi2TEpcI06PupcpUhMGFBMQ78rz48=
kcl-lang.io/kcl-go v0.8.0-beta.1/go.mod h1:b9vkWRTxSwy+rLvNJ+8/bNs4YvRXzi6WCN/M3lp0aXc=
kcl-lang.io/kcl-go v0.8.0 h1:ep+r4QMiAOeTkOJl9then58D+W8OpX5WHKuL+Tf8+po=
kcl-lang.io/kcl-go v0.8.0/go.mod h1:Z+bJWXe5X1Xra7AUOvDpCb4WBcCGNo0sqQG/bNjz6+k=
kcl-lang.io/kcl-openapi v0.5.5 h1:6LSbiy53nczagm7Ohgdy1DVgQ+5ffMihsOUY7PGkbh0=
kcl-lang.io/kcl-openapi v0.5.5/go.mod h1:Ai9mFztCVKkRSFabczO/r5hCNdqaNtAc2ZIRxTeV0Mk=
kcl-lang.io/kcl-playground v0.5.1 h1:MKQQUHgt4+2QyU2NVwa73oksOaBJGDi4keGoggA0MiU=
kcl-lang.io/kcl-playground v0.5.1/go.mod h1:IFmnlw7m011ccX8OidMUfnnN2u/TWdtQGxyABRTbmow=
kcl-lang.io/kpm v0.8.0-beta.1 h1:PVfB0R4mC9Wpmamsry/Dt70x1KdaVgA2iqjUeOFbyWo=
kcl-lang.io/kpm v0.8.0-beta.1/go.mod h1:4qKzxK349peQk1txQN/cwRwc9Q+hKJWriTCjExdI2aQ=
kcl-lang.io/lib v0.8.0-beta.1 h1:U5/Gv6zCp3XaS3OCVxUeaUa79dMXJcdQDisIyOha/po=
kcl-lang.io/lib v0.8.0-beta.1/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
kcl-lang.io/kpm v0.8.0 h1:iaF4+WckObYT4uHA27gPXKNYtF2dh6oOJemIbc9JolE=
kcl-lang.io/kpm v0.8.0/go.mod h1:4qKzxK349peQk1txQN/cwRwc9Q+hKJWriTCjExdI2aQ=
kcl-lang.io/lib v0.8.0 h1:bzMzPpaXaAxWO9JP0B7eI2ZFOYfojdEYUMtNGlUrPx4=
kcl-lang.io/lib v0.8.0/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
oras.land/oras-go v1.2.3 h1:v8PJl+gEAntI1pJ/LCrDgsuk+1PKVavVEPsYIHFE5uY=
oras.land/oras-go v1.2.3/go.mod h1:M/uaPdYklze0Vf3AakfarnpoEckvw0ESbRdN8Z1vdJg=
oras.land/oras-go/v2 v2.3.0 h1:lqX1aXdN+DAmDTKjiDyvq85cIaI4RkIKp/PghWlAGIU=
Expand Down
3 changes: 2 additions & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ func getVersion(version string) string {
}

const (
VersionTypeLatest = Version_0_8_0_beta_1
VersionTypeLatest = Version_0_8_0

Version_0_8_0 VersionType = "0.8.0"
Version_0_8_0_beta_1 VersionType = "0.8.0-beta.1"
Version_0_8_0_alpha_1 VersionType = "0.8.0-alpha.1"
Version_0_7_5 VersionType = "0.7.5"
Expand Down
Loading