Skip to content

Commit 9023bd7

Browse files
authored
Move package celext out of internal (#56)
Move `celext` out of internal so that `buf lint` can import this package and load `DefaultEnv` before checking if a CEL expression compiles.
1 parent e5ffd4a commit 9023bd7

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ issues:
6767
- varnamelen
6868
- unparam
6969
- gosec
70-
- path: internal/celext/lib.go
70+
- path: celext/lib.go
7171
linters:
7272
# setting up custom functions/overloads appears duplicative (false positive)
7373
- dupl
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ import (
3333
// DefaultEnv produces a cel.Env with the necessary cel.EnvOption and
3434
// cel.ProgramOption values preconfigured for usage throughout the
3535
// module. If useUTC is true, timestamp operations use the UTC timezone instead
36-
// of the local timezone. If locale is non-empty, the provided locale string is
37-
// used for string formatting, defaulting to 'en_US' if unset.
36+
// of the local timezone.
3837
func DefaultEnv(useUTC bool) (*cel.Env, error) {
3938
return cel.NewEnv(
4039
cel.Lib(lib{

internal/constraints/cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"testing"
1919

2020
"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
21-
"github.com/bufbuild/protovalidate-go/internal/celext"
21+
"github.com/bufbuild/protovalidate-go/celext"
2222
"github.com/bufbuild/protovalidate-go/internal/gen/buf/validate/conformance/cases"
2323
"github.com/google/cel-go/cel"
2424
"github.com/stretchr/testify/assert"

internal/evaluator/builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"sync"
1919
"testing"
2020

21-
"github.com/bufbuild/protovalidate-go/internal/celext"
21+
"github.com/bufbuild/protovalidate-go/celext"
2222
pb "github.com/bufbuild/protovalidate-go/internal/gen/tests/example/v1"
2323
"github.com/stretchr/testify/assert"
2424
"github.com/stretchr/testify/require"

internal/expression/ast_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"testing"
1919

2020
"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
21-
"github.com/bufbuild/protovalidate-go/internal/celext"
21+
"github.com/bufbuild/protovalidate-go/celext"
2222
"github.com/google/cel-go/cel"
2323
"github.com/stretchr/testify/assert"
2424
"github.com/stretchr/testify/require"

validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"fmt"
1919

2020
"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
21-
"github.com/bufbuild/protovalidate-go/internal/celext"
21+
"github.com/bufbuild/protovalidate-go/celext"
2222
"github.com/bufbuild/protovalidate-go/internal/errors"
2323
"github.com/bufbuild/protovalidate-go/internal/evaluator"
2424
"google.golang.org/protobuf/proto"

0 commit comments

Comments
 (0)