Skip to content

Commit

Permalink
Extended devcontainer functionality (#205)
Browse files Browse the repository at this point in the history
* configuration of nerdfont in devcontainer
  • Loading branch information
djschleen authored Feb 29, 2024
1 parent 6a46058 commit bd9d2b8
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 9 deletions.
75 changes: 68 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,69 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/aws-cli:1": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers-contrib/features/starship:1": {}
}
}
"name": "devcontainer-test",
"image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm",
"features": {
"ghcr.io/devcontainers-contrib/features/starship:1": {},
"ghcr.io/azutake/devcontainer-features/go-packages-install:0": {
"packages": [
"github.com/devops-kung-fu/hookz@latest",
"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": {
"terminal.integrated.fontFamily": "Cascadia Code",
"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"
}
},
"markiscodecoverage.coverageThreshold": 95,
"markiscodecoverage.enableOnStartup": true,
"markiscodecoverage.searchCriteria": "*.lcov*"
},
"extensions": [
"ms-vscode.go",
"golang.go",
"github.vscode-pull-request-github",
"github.vscode-github-actions",
"aleksandra.go-group-imports",
"oderwat.indent-rainbow",
"yzhang.markdown-all-in-one",
"quicktype.quicktype",
"jebbs.plantuml",
"foxundermoon.shell-format",
"ahebrank.yaml2json",
"amazonwebservices.aws-toolkit-vscode",
"markis.code-coverage",
//"defaltd.go-coverage-viewer",
"Gruntfuggly.todo-tree" // Highlights TODO comments"
]
}
},
"postCreateCommand": "/usr/bin/zsh ./.devcontainer/post-create.sh > ~/post-create.log"
}
6 changes: 6 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mkdir -p $HOME/.local/share/fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaCode.zip
unzip CascadiaCode.zip -d $HOME/.local/share/fonts
rm CascadiaCode.zip

go mod download && go mod tidy
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ bomber
/rest

*-results.html
coverage.html
coverage.html
coverage.lcov

*.log
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ build: ## Builds the application
go build

test: ## Runs tests and coverage
go test -v -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
go test -v -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
go tool cover -html=coverage.out -o coverage.html
gcov2lcov -infile=coverage.out -outfile=coverage.lcov

check: build ## Tests the pre-commit hooks if they exist
hookz reset --verbose --debug --verbose-output
Expand Down

0 comments on commit bd9d2b8

Please sign in to comment.