Skip to content
Open
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
6 changes: 6 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@
'renovate',
],
packageRules: [
{
matchPackageNames: [
'git.sr.ht/~nelsam/hel',
],
allowedVersions: '< 1.0.0',
},
{
matchPackageNames: [
'earthly/earthly',
Expand Down
30 changes: 14 additions & 16 deletions cmd/earthly/subcmd/cmds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import (
"fmt"
"testing"

"github.com/EarthBuild/earthbuild/cmd/earthly/app"
"github.com/EarthBuild/earthbuild/cmd/earthly/base"
"github.com/EarthBuild/earthbuild/cmd/earthly/subcmd"
"github.com/EarthBuild/earthbuild/conslogging"
"github.com/poy/onpar"
"github.com/poy/onpar/expect"
"github.com/poy/onpar/matchers"
"github.com/urfave/cli/v2"

"github.com/EarthBuild/earthbuild/cmd/earthly/app"
"github.com/EarthBuild/earthbuild/cmd/earthly/base"
"github.com/EarthBuild/earthbuild/cmd/earthly/subcmd"
)

func TestRootCmdsHelp(t *testing.T) {
Expand All @@ -24,15 +23,17 @@ func TestRootCmdsHelp(t *testing.T) {
expect expect.Expectation
}

o := onpar.BeforeEach(onpar.New(t), func(t *testing.T) testCtx {
o := onpar.New()

o.BeforeEach(func(t *testing.T) testCtx {
t.Helper()

return testCtx{
t: t,
expect: expect.New(t),
}
})
defer o.Run()
defer o.Run(t)

ctx := context.TODO()
newCLI := base.NewCLI(conslogging.ConsoleLogger{},
Expand All @@ -48,16 +49,13 @@ func TestRootCmdsHelp(t *testing.T) {

rootCLI := app.BaseCLI.App().Commands

usageChecks := onpar.TableSpec(o, func(tt testCtx, cmd *cli.Command) {
tt.expect(cmd.Usage).To(matchers.Not(matchers.EndWith(".")))
})
descChecks := onpar.TableSpec(o, func(tt testCtx, cmd *cli.Command) {
tt.expect(cmd.Description).To(matchers.EndWith("."))
})

for _, subCmd := range checkSubCommands(rootCLI) {
usageChecks.Entry(fmt.Sprintf("Help usage for %s should not end with '.'", subCmd.Name), subCmd)
descChecks.Entry(fmt.Sprintf("Help description for %s should end with '.'", subCmd.Name), subCmd)
for _, cmd := range checkSubCommands(rootCLI) {
o.Spec(fmt.Sprintf("Help usage for %s should not end with '.'", cmd.Name), func(tt testCtx) {
tt.expect(cmd.Usage).To(matchers.Not(matchers.EndWith(".")))
})
o.Spec(fmt.Sprintf("Help description for %s should end with '.'", cmd.Name), func(tt testCtx) {
tt.expect(cmd.Description).To(matchers.EndWith("."))
})
}
}

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25

require (
al.essio.dev/pkg/shellescape v1.6.0
git.sr.ht/~nelsam/hel v0.6.6
git.sr.ht/~nelsam/hel v0.9.0
github.com/adrg/xdg v0.5.3
github.com/alexcb/binarystream v0.0.0-20231130184431-f2f7a7543c6d
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc
Expand Down Expand Up @@ -39,7 +39,7 @@ require (
github.com/opencontainers/image-spec v1.1.1
github.com/otiai10/copy v1.14.1
github.com/pkg/errors v0.9.1
github.com/poy/onpar v0.3.5
github.com/poy/onpar v1.1.2
github.com/sirupsen/logrus v1.9.4
github.com/stretchr/testify v1.11.1
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302
Expand All @@ -55,7 +55,7 @@ require (
)

require (
git.sr.ht/~nelsam/correct v0.0.5 // indirect
git.sr.ht/~nelsam/correct v0.1.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.11.7 // indirect
Expand Down
110 changes: 104 additions & 6 deletions go.sum

Large diffs are not rendered by default.

Loading
Loading