Skip to content

all: (mostly) automated clean up #1513

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 2 commits into from
Sep 29, 2023
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
1 change: 1 addition & 0 deletions .github/workflows/cli-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
- run: go run ./cmd/devbox run fmt
- name: golangci-lint
uses: golangci/[email protected]
with:
Expand Down
33 changes: 26 additions & 7 deletions devbox.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add gofumpt here script here. Then we can add CICD that runs it and errors out if there are any changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a devbox run fmt script that runs in the lint job right before golangci-lint. If CI is set, it prints any unformatted files and exits with an error. When CI isn't set, it silently formats the files.

Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,42 @@
"go@latest"
],
"env": {
"GOENV": "off",
"PATH": "$PATH:$PWD/dist"
},
"shell": {
"init_hook": [
"export \"GOROOT=$(go env GOROOT)\""
"unset CGO_ENABLED GO111MODULE GOARCH GOFLAGS GOMOD GOOS GOROOT GOTOOLCHAIN GOWORK"
],
"scripts": {
"build": "go build -o dist/devbox cmd/devbox/main.go",
"build-linux": "GOOS=linux go build -o dist/devbox-linux cmd/devbox/main.go",
"build-linux-amd64": "GOOS=linux GOARCH=amd64 go build -o dist/devbox-linux-amd64 cmd/devbox/main.go",
"build": "go build -o dist/devbox ./cmd/devbox",
"build-all": [
"GOOS=darwin GOARCH=amd64 go build -o dist/devbox-darwin-amd64 ./cmd/devbox",
"GOOS=darwin GOARCH=arm64 go build -o dist/devbox-darwin-arm64 ./cmd/devbox",
"GOOS=linux GOARCH=amd64 go build -o dist/devbox-linux-amd64 ./cmd/devbox",
"GOOS=linux GOARCH=arm64 go build -o dist/devbox-linux-arm64 ./cmd/devbox"
],
"code": "code .",
"lint": "golangci-lint run",
"fmt": [
"mkdir -p dist/tools",
"export GOBIN=\"$PWD/dist/tools\"",
"go install mvdan.cc/gofumpt@latest",
"if [ -n \"${CI:-}\" ]; then",
" unformatted=\"$(find . -name '*.go' -exec \"$GOBIN/gofumpt\" -l {} \\+ | awk '{ print \"\t\" $0 }')\"",
" if [ -n \"$unformatted\" ]; then",
" echo 'The following files need to be formatted with gofumpt:'",
" echo",
" echo \"$unformatted\"",
" echo",
" echo 'Run `devbox run fmt` to format them.'",
" exit 1",
" fi",
"fi",
"find . -name '*.go' -exec \"$GOBIN/gofumpt\" -extra -w {} \\+"
],
"test": "go test -race -cover ./...",
"update-examples": "devbox run build && go run testscripts/testrunner/updater/main.go"
}
},
"nixpkgs": {
"commit": "3364b5b117f65fe1ce65a3cdd5612a078a3b31e3"
}
}
75 changes: 41 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ module go.jetpack.io/devbox
go 1.21

require (
github.com/AlecAivazis/survey/v2 v2.3.6
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/MakeNowJust/heredoc/v2 v2.0.1
github.com/alessio/shellescape v1.4.1
github.com/aws/aws-sdk-go-v2 v1.18.0
github.com/aws/aws-sdk-go-v2/config v1.18.25
github.com/aws/aws-sdk-go-v2/credentials v1.13.24
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.67
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.1
github.com/aws/aws-sdk-go-v2/service/sts v1.19.0
github.com/alessio/shellescape v1.4.2
github.com/aws/aws-sdk-go-v2 v1.21.0
github.com/aws/aws-sdk-go-v2/config v1.18.42
github.com/aws/aws-sdk-go-v2/credentials v1.13.40
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.87
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.0
github.com/aws/aws-sdk-go-v2/service/sts v1.22.0
github.com/bmatcuk/doublestar/v4 v4.6.0
github.com/briandowns/spinner v1.23.0
github.com/cavaliergopher/grab/v3 v3.0.1
github.com/cloudflare/ahocorasick v0.0.0-20210425175752-730270c3e184
github.com/creekorful/mvnparser v1.5.0
github.com/denisbrodbeck/machineid v1.0.1
github.com/f1bonacc1/process-compose v0.43.1
github.com/fatih/color v1.15.0
github.com/fsnotify/fsnotify v1.6.0
github.com/getsentry/sentry-go v0.20.0
github.com/getsentry/sentry-go v0.24.1
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.1
github.com/hashicorp/go-envparse v0.1.0
github.com/joho/godotenv v1.5.1
github.com/mattn/go-isatty v0.0.19
github.com/mholt/archiver/v4 v4.0.0-alpha.7
github.com/pelletier/go-toml/v2 v2.0.7
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/mholt/archiver/v4 v4.0.0-alpha.8
github.com/pelletier/go-toml/v2 v2.1.0
github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.11.0
github.com/samber/lo v1.38.1
Expand All @@ -39,9 +39,8 @@ require (
github.com/wk8/go-ordered-map/v2 v2.1.8
github.com/zealic/go2node v0.1.0
go.jetpack.io/pkg v0.0.0-20230920232528-54278537129b
golang.org/x/exp v0.0.0-20230807204917-050eac23e9de
golang.org/x/mod v0.11.0
golang.org/x/sync v0.1.0
golang.org/x/mod v0.12.0
golang.org/x/sync v0.3.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -51,29 +50,32 @@ require (
github.com/InVisionApp/go-logger v1.0.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.25 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.28 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.14 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.14.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1 // indirect
github.com/aws/smithy-go v1.14.2 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/bodgit/plumbing v1.2.0 // indirect
github.com/bodgit/sevenzip v1.3.0 // indirect
github.com/bodgit/windows v1.0.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/codeclysm/extract v2.2.0+incompatible // indirect
github.com/connesc/cipherio v0.2.1 // indirect
github.com/coreos/go-oidc/v3 v3.6.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/f1bonacc1/process-compose v0.43.1
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
Expand All @@ -85,26 +87,31 @@ require (
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/h2non/filetype v1.1.3 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/juju/errors v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/zerolog v1.29.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/segmentio/backo-go v1.0.1 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
Expand Down
Loading