-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes error checking, updated devcontainer
- Loading branch information
Showing
14 changed files
with
157 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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,7 +1,70 @@ | ||
{ | ||
"name": "hookz-devcontainer", | ||
"name": "devcontainer-test", | ||
"image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/starship:1": {} | ||
} | ||
"ghcr.io/devcontainers-contrib/features/starship:1": {}, | ||
"ghcr.io/azutake/devcontainer-features/go-packages-install:0": { | ||
"packages": [ | ||
"github.com/jandelgado/gcov2lcov@latest", | ||
"github.com/kisielk/errcheck@latest", | ||
"github.com/fzipp/gocyclo/cmd/gocyclo@latest", | ||
"golang.org/x/vuln/cmd/govulncheck@latest", | ||
"honnef.co/go/tools/cmd/staticcheck@latest" | ||
] | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"files.eol": "\n", | ||
"terminal.integrated.fontFamily": "DroidSansMNerdFont-Regular", | ||
"editor.formatOnSave": true, | ||
"go.buildTags": "", | ||
"go.toolsEnvVars": { | ||
"CGO_ENABLED": "0" | ||
}, | ||
"go.useLanguageServer": true, | ||
"go.testEnvVars": { | ||
"CGO_ENABLED": "1" | ||
}, | ||
"go.testFlags": [ | ||
"-v", | ||
"-race" | ||
], | ||
"go.testTimeout": "10s", | ||
"go.coverOnSingleTest": true, | ||
"go.coverOnSingleTestFile": true, | ||
"go.coverOnTestPackage": true, | ||
"go.lintTool": "golangci-lint", | ||
"go.lintOnSave": "package", | ||
"[go]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "always" | ||
} | ||
}, | ||
"gopls": { | ||
"usePlaceholders": false, | ||
"staticcheck": true, | ||
"vulncheck": "Imports" | ||
}, | ||
}, | ||
"extensions": [ | ||
"ms-vscode.go", | ||
"golang.go", | ||
"github.vscode-pull-request-github", | ||
"github.vscode-github-actions", | ||
"github.vscode-codeql", | ||
"aleksandra.go-group-imports", | ||
"oderwat.indent-rainbow", | ||
"yzhang.markdown-all-in-one", | ||
"quicktype.quicktype", | ||
"jebbs.plantuml", | ||
"foxundermoon.shell-format", | ||
"ahebrank.yaml2json", | ||
"defaltd.go-coverage-viewer", | ||
"Gruntfuggly.todo-tree", // Highlights TODO comments" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "go mod download && go mod tidy && mkdir -p ~/.local/share/fonts && cd ~/.local/share/fonts && curl -fLO https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/DroidSansMono/DroidSansMNerdFont-Regular.otf" | ||
} |
This file contains 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 |
---|---|---|
|
@@ -17,5 +17,6 @@ | |
hookz | ||
coverage.out | ||
coverage.html | ||
coverage.lcov | ||
|
||
.DS_Store |
This file contains 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 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,22 @@ | ||
// cmd/root_test.go | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/devops-kung-fu/common/util" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestExecuteCommand(t *testing.T) { | ||
// Set up a test command | ||
cmd := resetCmd | ||
|
||
// Capture standard output for testing | ||
output := util.CaptureOutput(func() { | ||
cmd.SetArgs([]string{"reset"}) | ||
_ = cmd.Execute() | ||
}) | ||
|
||
assert.Contains(t, output, "Manages commit hooks inside a local git repository") | ||
} |
This file contains 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,21 @@ | ||
// cmd/root_test.go | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/devops-kung-fu/common/util" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_rootCommand(t *testing.T) { | ||
// Set up a test command | ||
cmd := updateCmd | ||
|
||
// Capture standard output for testing | ||
output := util.CaptureOutput(func() { | ||
_ = cmd.Execute() | ||
}) | ||
|
||
assert.Contains(t, output, "Manages commit hooks inside a local git repository") | ||
} |
This file contains 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,22 @@ | ||
// cmd/root_test.go | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/devops-kung-fu/common/util" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_updateCommand(t *testing.T) { | ||
// Set up a test command | ||
cmd := updateCmd | ||
|
||
// Capture standard output for testing | ||
output := util.CaptureOutput(func() { | ||
cmd.SetArgs([]string{"update"}) | ||
_ = cmd.Execute() | ||
}) | ||
|
||
assert.Contains(t, output, "Manages commit hooks inside a local git repository") | ||
} |
This file contains 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 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 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 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 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 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 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 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