Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into go-reserved-words
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusvniekerk committed Apr 2, 2024
2 parents 1c177db + cc361e0 commit a071348
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 66 deletions.
87 changes: 48 additions & 39 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,80 +1,89 @@
{
constraints: {
"go": "1.19"
go: '1.21',
},
extends: [
"config:base"
'config:recommended',
'default:pinDigestsDisabled',
],
configMigration: true,
enabledManagers: [
"regex",
"github-actions",
"gomod"
'custom.regex',
'github-actions',
'gomod',
],
postUpdateOptions: [
"gomodTidy"
'gomodTidy',
],
regexManagers: [
customManagers: [
{
fileMatch: [
".github/renovate.json5$",
"Earthfile$"
customType: 'regex',
fileMatch: [
'.github/renovate.json5$',
'Earthfile$',
],
matchStrings: [
"GO_VERSION=(?<currentValue>.*?)\\n",
"constraints: {(\\s*\\n\\s*)\"go\":\\s*\"(?<currentValue>.*?)\"",
"ARG go_version=(?<currentValue>.*?)\\n"
'GO_VERSION=(?<currentValue>.*?)\\n',
'constraints: {(\\s*\\n\\s*)"go":\\s*"(?<currentValue>.*?)"',
'ARG go_version=(?<currentValue>.*?)\\n',
],
depNameTemplate: "go",
datasourceTemplate: "golang-version",
versioningTemplate: "npm",
depNameTemplate: 'go',
datasourceTemplate: 'golang-version',
versioningTemplate: 'npm',
},
{
customType: 'regex',
fileMatch: [
"Earthfile$"
'Earthfile$',
],
matchStrings: [
"ARG ALPINE_VERSION=(?<currentValue>.*?)\\n"
'ARG ALPINE_VERSION=(?<currentValue>.*?)\\n',
],
depNameTemplate: "alpine",
datasourceTemplate: "docker"
depNameTemplate: 'alpine',
datasourceTemplate: 'docker',
},
{
customType: 'regex',
fileMatch: [
"Earthfile$"
'Earthfile$',
],
matchStrings: [
"ARG LINTER_VERSION=(?<currentValue>.*?)\\n"
'ARG LINTER_VERSION=(?<currentValue>.*?)\\n',
],
depNameTemplate: "golangci/golangci-lint",
datasourceTemplate: "github-releases"
depNameTemplate: 'golangci/golangci-lint',
datasourceTemplate: 'github-releases',
},
{
customType: 'regex',
fileMatch: [
"Earthfile$"
'Earthfile$',
],
matchStrings: [
"ARG DOCKER_PROTOC_VERSION=(?<currentValue>.*?)\\n"
'ARG DOCKER_PROTOC_VERSION=(?<currentValue>.*?)\\n',
],
depNameTemplate: "namely/protoc-all",
datasourceTemplate: "docker",
versioningTemplate: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)_(?<patch>\\d+)$"
depNameTemplate: 'namely/protoc-all',
datasourceTemplate: 'docker',
versioningTemplate: 'regex:^(?<major>\\d+)\\.(?<minor>\\d+)_(?<patch>\\d+)$',
},
{
customType: 'regex',
fileMatch: [
".github/workflows/ci.yml$",
".github/workflows/release.yml$"
'.github/workflows/ci.yml$',
'.github/workflows/release.yml$',
],
matchStrings: [
"version: (?<currentValue>.*?)\\n"
'version: (?<currentValue>.*?)\\n',
],
depNameTemplate: "earthly/earthly",
datasourceTemplate: "github-releases"
}
depNameTemplate: 'earthly/earthly',
datasourceTemplate: 'github-releases',
},
],
packageRules: [
{
matchDatasources: ["go"],
groupName: "go modulesUpgrades"
}
]
matchDatasources: [
'go',
],
groupName: 'go modulesUpgrades',
},
],
}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: nelonoel/[email protected]

- uses: earthly/actions/setup-earthly@v1
- uses: earthly/actions/setup-earthly@main
with:
version: v0.6.24
version: v0.7.22

- name: Earthly Version
run: earthly --version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: nelonoel/[email protected]

- uses: earthly/actions/setup-earthly@v1
with:
version: v0.6.24
version: v0.7.22

- name: Earthly Version
run: earthly --version
Expand Down
12 changes: 6 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION 0.6
VERSION 0.7

ARG ALPINE_VERSION=3.16
ARG GO_VERSION=1.19
ARG LINTER_VERSION=v1.49.0
ARG ALPINE_VERSION=3.18
ARG GO_VERSION=1.21
ARG LINTER_VERSION=v1.56.2
FROM golang:$GO_VERSION-alpine$ALPINE_VERSION
WORKDIR /app

Expand All @@ -20,7 +20,7 @@ lint:
# Installs golangci-lint to ./bin
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $LINTER_VERSION
COPY +stage/app .
RUN ./bin/golangci-lint run --skip-dirs=vendor --skip-dirs=./gen/ --deadline=5m --tests=true -E revive \
RUN ./bin/golangci-lint run --skip-dirs=vendor --skip-dirs=./gen/ --deadline=10m --tests=true -E revive \
-E gosec -E unconvert -E goconst -E gocyclo -E goimports

build:
Expand Down Expand Up @@ -52,7 +52,7 @@ build-all:
SAVE ARTIFACT /artifacts AS LOCAL bin

test-gen:
ARG DOCKER_PROTOC_VERSION=1.49_0
ARG DOCKER_PROTOC_VERSION=1.51_2
FROM namely/protoc-all:$DOCKER_PROTOC_VERSION
RUN mkdir /plugins
COPY +build/protoc-gen-fieldmask /usr/local/bin/.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ fieldmasks paths can be used as follows:
```golang
foo := &example.Foo{}

# Prints "baz"
// Prints "baz"
fmt.Println(foo.FieldMaskPaths().Baz())

# Prints "xyz"
// Prints "xyz"
fmt.Println(foo.FieldMaskPaths().Xyz())

# prints "my_bar"
// Prints "my_bar"
fmt.Println(foo.FieldMaskPaths().MyBar().String())

# since baz is a nested message, we can print a nested path - "my_bar.some_field"
// Since baz is a nested message, we can print a nested path - "my_bar.some_field"
fmt.Println(foo.FieldMaskPaths().MyBar().SomeField())

# thirdparty messages work the same way:
#print "some_date"
// Thirdparty messages work the same way:
// Prints "some_date"
fmt.Println(foo.FieldMaskPaths().SomeDate().String())

#print "some_date.year"
// Prints "some_date.year"
fmt.Println(foo.FieldMaskPaths().SomeDate().Year())
```

Expand All @@ -69,7 +69,7 @@ The plugin can be downloaded from the [release page](https://github.com/idodod/p
```sh
protoc --fieldmask_out=gen protos/example.proto

# if the plugin is not in your $PATH:
# If the plugin is not in your $PATH:
protoc --fieldmask_out=out_dir protos/example.proto --plugin=protoc-gen-fieldmask=/path/to/protoc-gen-fieldmask
```

Expand Down
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
module github.com/idodod/protoc-gen-fieldmask

go 1.19
go 1.21

require (
github.com/iancoleman/strcase v0.2.0
github.com/stretchr/testify v1.8.0
google.golang.org/protobuf v1.28.1
github.com/stretchr/testify v1.8.4
google.golang.org/protobuf v1.30.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20220902135211-223410557253 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20220902135211-223410557253 h1:vXJMM8Shg7TGaYxZsQ++A/FOSlbDmDtWhS/o+3w/hj4=
google.golang.org/genproto v0.0.0-20220902135211-223410557253/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao=
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down

0 comments on commit a071348

Please sign in to comment.