Compare commits

..

No commits in common. "7e2b50faf0403e5a80e81f489f878a97f9d7548d" and "bc637b3a77973d9c3b2e0a01870023f9705e9391" have entirely different histories.

4 changed files with 20 additions and 20 deletions

View File

@ -54,7 +54,7 @@
"mounts": [ "mounts": [
"source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind,consistency=cached" "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind,consistency=cached"
], ],
// Forward the default HTTP port so `make run` is reachable from the host. // Forward the default HTTP port so `make run` is reachable from the host.
"forwardPorts": [8080], "forwardPorts": [8080],

View File

@ -1,10 +1,12 @@
{ {
// Go // Go
"go.useLanguageServer": true,
"go.lintTool": "golangci-lint", "go.lintTool": "golangci-lint",
"go.lintFlags": ["--fast"], "go.lintFlags": ["--fast"],
"go.lintOnSave": "workspace", "go.lintOnSave": "workspace",
"go.testFlags": ["-race"], "go.testFlags": ["-race"],
"go.coverOnSave": false, "go.coverOnSave": false,
"go.generateOnSave": false,
// Editor // Editor
"[go]": { "[go]": {
@ -14,6 +16,9 @@
"source.organizeImports": "explicit" "source.organizeImports": "explicit"
} }
}, },
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
// Files // Files
"files.exclude": { "files.exclude": {
@ -22,15 +27,16 @@
}, },
"search.exclude": { "search.exclude": {
"**/bin": true, "**/bin": true,
"**/mocks": true,
"**/vendor": true "**/vendor": true
}, },
// Test explorer // Test explorer
"go.testExplorer.enable": true, "go.testExplorer.enable": true,
"makefile.configureOnOpen": false,
"cSpell.words": [ "cSpell.words": [
"djmil", "djmil",
"gitea", "gitea",
"golangci",
"testutil" "testutil"
] ]
} }

7
.vscode/tasks.json vendored
View File

@ -41,6 +41,13 @@
"presentation": { "reveal": "always", "panel": "shared" }, "presentation": { "reveal": "always", "panel": "shared" },
"problemMatcher": "$go" "problemMatcher": "$go"
}, },
{
"label": "mocks",
"type": "shell",
"command": "make mocks",
"group": "none",
"presentation": { "reveal": "always", "panel": "shared" }
},
{ {
"label": "security scan", "label": "security scan",
"type": "shell", "type": "shell",

View File

@ -126,24 +126,11 @@ sedi() {
fi fi
} }
# ── Helper: rename module path in a file, preserving pkg/result imports ───────
# pkg/result is a standalone publishable package; its import path must not
# change when the consuming project is renamed.
RESULT_PKG="${OLD_MODULE}/pkg/result"
PLACEHOLDER="__RESULT_PKG_PLACEHOLDER__"
rename_module_in() {
local file="$1"
sedi "s|${RESULT_PKG}|${PLACEHOLDER}|g" "$file"
sedi "s|${OLD_MODULE}|${NEW_MODULE}|g" "$file"
sedi "s|${PLACEHOLDER}|${RESULT_PKG}|g" "$file"
}
# ── Apply substitutions ─────────────────────────────────────────────────────── # ── Apply substitutions ───────────────────────────────────────────────────────
heading "Applying changes" heading "Applying changes"
# 1. go.mod — module declaration # 1. go.mod — module declaration
rename_module_in go.mod sedi "s|${OLD_MODULE}|${NEW_MODULE}|g" go.mod
info "go.mod" info "go.mod"
# 2. All Go source files — import paths # 2. All Go source files — import paths
@ -156,7 +143,7 @@ GO_FILES=$(find . \
CHANGED_GO=0 CHANGED_GO=0
for f in $GO_FILES; do for f in $GO_FILES; do
if grep -q "$OLD_MODULE" "$f" 2>/dev/null; then if grep -q "$OLD_MODULE" "$f" 2>/dev/null; then
rename_module_in "$f" sedi "s|${OLD_MODULE}|${NEW_MODULE}|g" "$f"
CHANGED_GO=$((CHANGED_GO + 1)) CHANGED_GO=$((CHANGED_GO + 1))
fi fi
done done
@ -172,19 +159,19 @@ fi
# 4. README.md — heading + all module path occurrences # 4. README.md — heading + all module path occurrences
if [[ -f README.md ]]; then if [[ -f README.md ]]; then
sedi "s|^# ${OLD_PROJECT}$|# ${NEW_PROJECT}|g" README.md sedi "s|^# ${OLD_PROJECT}$|# ${NEW_PROJECT}|g" README.md
rename_module_in README.md sedi "s|${OLD_MODULE}|${NEW_MODULE}|g" README.md
info "README.md" info "README.md"
fi fi
# 5. CLAUDE.md — Module line # 5. CLAUDE.md — Module line
if [[ -f CLAUDE.md ]]; then if [[ -f CLAUDE.md ]]; then
rename_module_in CLAUDE.md sedi "s|${OLD_MODULE}|${NEW_MODULE}|g" CLAUDE.md
info "CLAUDE.md" info "CLAUDE.md"
fi fi
# 6. .golangci.yml — goimports local-prefixes # 6. .golangci.yml — goimports local-prefixes
if [[ -f .golangci.yml ]]; then if [[ -f .golangci.yml ]]; then
rename_module_in .golangci.yml sedi "s|${OLD_MODULE}|${NEW_MODULE}|g" .golangci.yml
info ".golangci.yml" info ".golangci.yml"
fi fi