Skip to content

Commit 49495b8

Browse files
authored
Merge pull request #8 from thediveo/develop
Develop
2 parents 471f81c + 9d7d97a commit 49495b8

File tree

9 files changed

+61
-180
lines changed

9 files changed

+61
-180
lines changed

Diff for: .devcontainer/devcontainer.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "enumflag",
3+
"portsAttributes": {
4+
"6060": {
5+
"label": "enumflag package documentation",
6+
"onAutoForward": "notify",
7+
"protocol": "http"
8+
}
9+
},
10+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
11+
"features": {
12+
"ghcr.io/thediveo/devcontainer-features/local-pkgsite:0": {},
13+
"ghcr.io/thediveo/devcontainer-features/goreportcard:0": {},
14+
"ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:0": {},
15+
"ghcr.io/thediveo/devcontainer-features/gocover:0": {
16+
"num-programs": "1",
17+
"race": true,
18+
"verbose": true,
19+
"html": true
20+
}
21+
},
22+
"remoteEnv": {
23+
"GOPATH": "/home/vscode/go",
24+
"PATH": "/home/vscode/go/bin:/go/bin:/usr/local/go/bin:${localEnv:PATH}"
25+
},
26+
"customizations": {
27+
"vscode": {
28+
"extensions": [
29+
"stkb.rewrap",
30+
"brunnerh.insert-unicode",
31+
"mhutchie.git-graph",
32+
"ms-vscode.makefile-tools"
33+
]
34+
}
35+
}
36+
}

Diff for: .vscode/tasks.json

-34
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,6 @@
4545
"kind": "build",
4646
"isDefault": true
4747
}
48-
},
49-
{
50-
"label": "View Go module documentation",
51-
"dependsOrder": "parallel",
52-
"dependsOn": [
53-
"don't Run Task this! -- pkgsite service",
54-
"don't Run Task this! -- view pkgsite"
55-
],
56-
"problemMatcher": []
57-
},
58-
{
59-
"label": "don't Run Task this! -- view pkgsite",
60-
"command": "${input:pkgsite}",
61-
},
62-
{
63-
"label": "don't Run Task this! -- pkgsite service",
64-
"type": "shell",
65-
"command": "${workspaceFolder}/scripts/pkgsite.sh",
66-
"presentation": {
67-
"echo": true,
68-
"reveal": "always",
69-
"focus": false,
70-
"panel": "shared",
71-
"showReuseMessage": false,
72-
"close": true,
73-
}
74-
}
75-
],
76-
"inputs": [
77-
{
78-
"id": "pkgsite",
79-
"type": "command",
80-
"command": "simpleBrowser.api.open",
81-
"args": "http://localhost:6060/github.com/thediveo/enumflag/v2"
8248
}
8349
]
8450
}

Diff for: Makefile

+6-14
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,13 @@ help: ## list available targets
77
clean: ## cleans up build and testing artefacts
88
rm -f coverage.*
99

10-
coverage: ## gathers coverage and updates README badge
11-
@scripts/cov.sh
12-
13-
pkgsite: ## serves Go documentation on port 6060
14-
@echo "navigate to: http://localhost:6060/github.com/thediveo/enumflag/v2"
15-
@scripts/pkgsite.sh
16-
17-
report: ## run goreportcard on this module
18-
@scripts/goreportcard.sh
19-
2010
test: ## run unit tests
2111
go test -v -p=1 -race ./...
2212

23-
vuln: ## runs govulncheck
24-
@scripts/vuln.sh
13+
report: ## run goreportcard-cli on this module
14+
# from ghcr.io/thediveo/devcontainer-features/goreportcard
15+
goreportcard-cli -v ./..
2516

26-
chores: ## updates Go binaries and NPM helper packages if necessary
27-
@scripts/chores.sh
17+
coverage: ## gathers coverage and updates README badge
18+
# from ghcr.io/thediveo/devcontainer-features/gocover
19+
gocover

Diff for: README.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,23 @@ func Example_slice() {
344344
}
345345
```
346346

347+
## DevContainer
348+
349+
First method:
350+
351+
1. in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
352+
2. select `enumflag.code-workspace` and off you go...
353+
354+
Second method:
355+
356+
1. In VSCode: Ctrl+Shift+P, "Dev Containers: Clone Repository in Container Volume..."
357+
2. select "Github"
358+
3. enter "thediveo/enumflag" and off you go...
359+
347360
## VSCode Tasks
348361

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

351-
- **View Go module documentation** task: installs `pkgsite`, if not done already
352-
so, then starts `pkgsite` and opens VSCode's integrated ("simple") browser to
353-
show the go-plugger/v2 documentation.
354-
355364
- **Build workspace** task: builds all, including the shared library test
356365
plugin.
357366

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

375384
## Make Targets
376385

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

390393
## Contributing
391394

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

394397
## Copyright and License
395398

396-
`lxkns` is Copyright 2020, 2023 Harald Albrecht, and licensed under the Apache
399+
`lxkns` is Copyright 2020, 2025 Harald Albrecht, and licensed under the Apache
397400
License, Version 2.0.

Diff for: scripts/chores.sh

-23
This file was deleted.

Diff for: scripts/cov.sh

-33
This file was deleted.

Diff for: scripts/goreportcard.sh

-19
This file was deleted.

Diff for: scripts/pkgsite.sh

-25
This file was deleted.

Diff for: scripts/vuln.sh

-16
This file was deleted.

0 commit comments

Comments
 (0)