Skip to content

Commit

Permalink
Merge pull request #8 from thediveo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
thediveo authored Jan 5, 2025
2 parents 471f81c + 9d7d97a commit 49495b8
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 180 deletions.
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "enumflag",
"portsAttributes": {
"6060": {
"label": "enumflag package documentation",
"onAutoForward": "notify",
"protocol": "http"
}
},
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"ghcr.io/thediveo/devcontainer-features/local-pkgsite:0": {},
"ghcr.io/thediveo/devcontainer-features/goreportcard:0": {},
"ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:0": {},
"ghcr.io/thediveo/devcontainer-features/gocover:0": {
"num-programs": "1",
"race": true,
"verbose": true,
"html": true
}
},
"remoteEnv": {
"GOPATH": "/home/vscode/go",
"PATH": "/home/vscode/go/bin:/go/bin:/usr/local/go/bin:${localEnv:PATH}"
},
"customizations": {
"vscode": {
"extensions": [
"stkb.rewrap",
"brunnerh.insert-unicode",
"mhutchie.git-graph",
"ms-vscode.makefile-tools"
]
}
}
}
34 changes: 0 additions & 34 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,40 +45,6 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "View Go module documentation",
"dependsOrder": "parallel",
"dependsOn": [
"don't Run Task this! -- pkgsite service",
"don't Run Task this! -- view pkgsite"
],
"problemMatcher": []
},
{
"label": "don't Run Task this! -- view pkgsite",
"command": "${input:pkgsite}",
},
{
"label": "don't Run Task this! -- pkgsite service",
"type": "shell",
"command": "${workspaceFolder}/scripts/pkgsite.sh",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"close": true,
}
}
],
"inputs": [
{
"id": "pkgsite",
"type": "command",
"command": "simpleBrowser.api.open",
"args": "http://localhost:6060/github.com/thediveo/enumflag/v2"
}
]
}
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ help: ## list available targets
clean: ## cleans up build and testing artefacts
rm -f coverage.*

coverage: ## gathers coverage and updates README badge
@scripts/cov.sh

pkgsite: ## serves Go documentation on port 6060
@echo "navigate to: http://localhost:6060/github.com/thediveo/enumflag/v2"
@scripts/pkgsite.sh

report: ## run goreportcard on this module
@scripts/goreportcard.sh

test: ## run unit tests
go test -v -p=1 -race ./...

vuln: ## runs govulncheck
@scripts/vuln.sh
report: ## run goreportcard-cli on this module
# from ghcr.io/thediveo/devcontainer-features/goreportcard
goreportcard-cli -v ./..

chores: ## updates Go binaries and NPM helper packages if necessary
@scripts/chores.sh
coverage: ## gathers coverage and updates README badge
# from ghcr.io/thediveo/devcontainer-features/gocover
gocover
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,23 @@ func Example_slice() {
}
```

## DevContainer

First method:

1. in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
2. select `enumflag.code-workspace` and off you go...

Second method:

1. In VSCode: Ctrl+Shift+P, "Dev Containers: Clone Repository in Container Volume..."
2. select "Github"
3. enter "thediveo/enumflag" and off you go...

## VSCode Tasks

The included `enumflag.code-workspace` defines the following tasks:

- **View Go module documentation** task: installs `pkgsite`, if not done already
so, then starts `pkgsite` and opens VSCode's integrated ("simple") browser to
show the go-plugger/v2 documentation.

- **Build workspace** task: builds all, including the shared library test
plugin.

Expand All @@ -374,24 +383,18 @@ The included `enumflag.code-workspace` defines the following tasks:

## Make Targets

- `make`: lists all targets.
- `make coverage`: runs all tests with coverage and then **updates the coverage
badge in `README.md`**.
- `make pkgsite`: installs [`x/pkgsite`](golang.org/x/pkgsite/cmd/pkgsite), as
well as the [`browser-sync`](https://www.npmjs.com/package/browser-sync) and
[`nodemon`](https://www.npmjs.com/package/nodemon) npm packages first, if not
already done so. Then runs the `pkgsite` and hot reloads it whenever the
documentation changes.
- `make report`: installs
[`@gojp/goreportcard`](https://github.com/gojp/goreportcard) if not yet done
so and then runs it on the code base.
- `make`: lists available targets.
- `make test`: runs all tests.
- `make coverage`: deprecated, use the `gocover` CLI command in the devcontainer
instead.
- `make report`: deprecated, use the `goreportcard-cli` CLI command in the
devcontainer instead.

## Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md).

## Copyright and License

`lxkns` is Copyright 2020, 2023 Harald Albrecht, and licensed under the Apache
`lxkns` is Copyright 2020, 2025 Harald Albrecht, and licensed under the Apache
License, Version 2.0.
23 changes: 0 additions & 23 deletions scripts/chores.sh

This file was deleted.

33 changes: 0 additions & 33 deletions scripts/cov.sh

This file was deleted.

19 changes: 0 additions & 19 deletions scripts/goreportcard.sh

This file was deleted.

25 changes: 0 additions & 25 deletions scripts/pkgsite.sh

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/vuln.sh

This file was deleted.

0 comments on commit 49495b8

Please sign in to comment.