-
Notifications
You must be signed in to change notification settings - Fork 14
update to Go 1.18 #29
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| run: | ||
| timeout: 10m | ||
|
|
||
| linters: | ||
| enable: | ||
| - deadcode | ||
| - depguard | ||
| - gofmt | ||
| - goimports | ||
| - revive | ||
| - govet | ||
| - importas | ||
| - ineffassign | ||
| - misspell | ||
| - typecheck | ||
| - varcheck | ||
| - errname | ||
| - makezero | ||
| - whitespace | ||
| disable-all: true | ||
|
|
||
| linters-settings: | ||
| depguard: | ||
| list-type: blacklist | ||
| include-go-root: true | ||
| packages: | ||
| # The io/ioutil package has been deprecated. | ||
| # https://go.dev/doc/go1.16#ioutil | ||
| - io/ioutil | ||
| importas: | ||
| no-unaliased: true | ||
|
|
||
| issues: | ||
| exclude-rules: | ||
| - linters: | ||
| - revive | ||
| text: "stutters" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| # Copyright 2021 cli-docs-tool authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| ARG GO_VERSION="1.18" | ||
| ARG GOLANGCI_LINT_VERSION="v1.45" | ||
| ARG ADDLICENSE_VERSION="v1.0.0" | ||
|
|
||
| ARG LICENSE_ARGS="-c cli-docs-tool -l apache" | ||
| ARG LICENSE_FILES=".*\(Dockerfile\|\.go\|\.hcl\|\.sh\)" | ||
|
|
||
| FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint | ||
| FROM ghcr.io/google/addlicense:${ADDLICENSE_VERSION} AS addlicense | ||
|
|
||
| FROM golang:${GO_VERSION}-alpine AS base | ||
| RUN apk add --no-cache cpio findutils git linux-headers | ||
| ENV CGO_ENABLED=0 | ||
| WORKDIR /src | ||
|
|
||
| FROM base AS vendored | ||
| RUN --mount=type=bind,target=.,rw \ | ||
| --mount=type=cache,target=/go/pkg/mod \ | ||
| go mod tidy && go mod download && \ | ||
| mkdir /out && cp go.mod go.sum /out | ||
|
|
||
| FROM scratch AS vendor-update | ||
| COPY --from=vendored /out / | ||
|
|
||
| FROM vendored AS vendor-validate | ||
| RUN --mount=type=bind,target=.,rw <<EOT | ||
| set -e | ||
| git add -A | ||
| cp -rf /out/* . | ||
| diff=$(git status --porcelain -- go.mod go.sum) | ||
| if [ -n "$diff" ]; then | ||
| echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"' | ||
| echo "$diff" | ||
| exit 1 | ||
| fi | ||
| EOT | ||
|
|
||
| FROM base AS lint | ||
| RUN --mount=type=bind,target=. \ | ||
| --mount=type=cache,target=/root/.cache \ | ||
| --mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \ | ||
| golangci-lint run ./... | ||
|
|
||
| FROM base AS license-set | ||
| ARG LICENSE_ARGS | ||
| ARG LICENSE_FILES | ||
| RUN --mount=type=bind,target=.,rw \ | ||
| --mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \ | ||
| find . -regex "${LICENSE_FILES}" | xargs addlicense ${LICENSE_ARGS} \ | ||
| && mkdir /out \ | ||
| && find . -regex "${LICENSE_FILES}" | cpio -pdm /out | ||
|
|
||
| FROM scratch AS license-update | ||
| COPY --from=set /out / | ||
|
|
||
| FROM base AS license-validate | ||
| ARG LICENSE_ARGS | ||
| ARG LICENSE_FILES | ||
| RUN --mount=type=bind,target=. \ | ||
| --mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \ | ||
| find . -regex "${LICENSE_FILES}" | xargs addlicense -check ${LICENSE_ARGS} | ||
|
|
||
| FROM vendored AS test | ||
| RUN --mount=type=bind,target=. \ | ||
| --mount=type=cache,target=/root/.cache \ | ||
| --mount=type=cache,target=/go/pkg/mod \ | ||
| go test -v -coverprofile=/tmp/coverage.txt -covermode=atomic ./... | ||
|
|
||
| FROM scratch AS test-coverage | ||
| COPY --from=test /tmp/coverage.txt /coverage.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,17 @@ | ||
| module github.com/docker/cli-docs-tool | ||
|
|
||
| go 1.16 | ||
| go 1.18 | ||
|
|
||
| require ( | ||
| github.com/spf13/cobra v1.2.1 | ||
| github.com/spf13/pflag v1.0.5 | ||
| github.com/stretchr/testify v1.7.0 | ||
| gopkg.in/yaml.v2 v2.4.0 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
| ) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know which ones it complained about? (and if we could possibly rename them to not "stutter")?