moved dep tests to golangci-lint

quietlight
May 6, 2026, 11:31 PM
VNFPBXF7OPUPHHDUE6I3VAOOQGSTVGMCZKWVG44ZGO6FN6JVFGIQC

Dependencies

  • [2] X3CP3AML changed import of pi-gondolin.ts to make it work with global volta install
  • [3] Q4JPMGET fixed tests
  • [4] AISACMH6 me
  • [5] DNLR36BZ minor comments
  • [6] P6HBSK3W me
  • [7] KZKLAINJ run out of space on nest, cleaned out
  • [8] BZ6KQRYD added complexity lint test
  • [9] VYNOHQJW tidied up CLAUDE.md
  • [10] 5O2QH5NZ added pi-gondolin.ts for quemu vm
  • [11] JZRF7OBJ refactor to get db omports out of utils, but still have failing tests, may need updating
  • [*] I4CMOMXF dot files
  • [*] JAT3DXOL cyclo over 15

Change contents

  • replacement in me.txt at line 213
    [4.733898][4.733898:733957]()
    jsonfile = "$item/segment_summary_2026-04-19.json"
    [4.733898]
    [4.733957]
    jsonfile = "$item/segment_summary_2026-05-07.json"
  • edit in me.txt at line 600
    [2.273][2.273:306]()
    guru callers ./pkg/path/funcname
  • edit in me.txt at line 601
    [2.307][2.307:317]()
    callgraph
  • replacement in me.txt at line 610
    [2.546][2.546:566]()
    pi -e pi-gondolin.ts
    [2.546]
    pi -e pi-gondolin.ts
    guru callers ./pkg/path/funcname
    ### Callgraph Commands
    1. Full project-internal callgraph (best for understanding code flow):
    ```bash
    callgraph -algo rta skraak 2>/dev/null | awk -F'\t' '$1 ~ /^skraak/ && $3 ~ /^skraak/' | grep -v '\$' | sed 's/--static-[0-9]*:[0-9]*-->/ →/; s/--dynamic-[0-9]*:[0-9]*-->/ →/' | sort -u
    ```
    2. Cross-package calls only (who calls across package boundaries):
    ```bash
    callgraph -algo rta skraak 2>/dev/null | awk -F'\t' '$1 ~ /^skraak/ && $3 ~ /^skraak/' | grep -v '\$' | awk -F'\t' '{split($1,a,"."); split($3,b,"."); if(a[1]!=b[1]) print}' | sed 's/--static-[0-9]*:[0-9]*-->/ →/; s/--dynamic-[0-9]*:[0-9]*-->/ →/' | sort -u
    ```
    3. Trace a specific function — "what does CallsClip call?":
    ```bash
    callgraph -algo rta skraak 2>/dev/null | grep 'tools.CallsClip\t' | grep -v '\$'
    ```
    4. Who calls a specific function — "who uses GenerateSpectrogram?":
    ```bash
    callgraph -algo rta skraak 2>/dev/null | grep 'GenerateSpectrogram' | grep -v '\$' | grep -v 'GenerateSpectrogram\t.*→.*GenerateSpectrogram'
    ```
    5. Dynamic (interface/virtual) calls only — find where interfaces dispatch:
    ```bash
    callgraph -algo rta skraak 2>/dev/null | grep 'dynamic' | grep '^skraak'
    ```
  • edit in lint_test.go at line 5
    [4.776200][3.163:174]()
    "strings"
  • edit in lint_test.go at line 55
    [4.340][3.175:2055]()
    // TestPackageDependencies enforces the project's package dependency rules
    // defined in CLAUDE.md. Packages may only import packages below them:
    //
    // cmd → tools, tui, utils, db
    // tools → utils, db
    // tui → tools, utils
    // utils → (nothing — leaf package)
    // db → utils
    func TestPackageDependencies(t *testing.T) {
    rules := map[string]map[string]bool{
    "skraak/cmd": {"skraak/tools": true, "skraak/tui": true, "skraak/utils": true, "skraak/db": true},
    "skraak/tools": {"skraak/utils": true, "skraak/db": true},
    "skraak/tui": {"skraak/tools": true, "skraak/utils": true},
    "skraak/utils": {}, // leaf package — no skraak imports allowed
    "skraak/db": {"skraak/utils": true},
    }
    for pkg, allowed := range rules {
    imports := getInternalImports(t, pkg)
    for _, imp := range imports {
    if !allowed[imp] {
    t.Errorf("%s imports %s — not allowed by dependency rules", pkg, imp)
    }
    }
    }
    }
    // TestNoDirectDBImportInUtils checks that no file in utils/ imports skraak/db.
    // Fast source-level check using go/packages.
    func TestNoDirectDBImportInUtils(t *testing.T) {
    importPaths := getInternalImports(t, "skraak/utils")
    for _, imp := range importPaths {
    if imp == "skraak/db" {
    t.Error("utils/ imports skraak/db — forbidden (utils is the leaf package)")
    }
    }
    }
    // getInternalImports returns the skraak-internal imports for a package using `go list`.
    func getInternalImports(t *testing.T, pkg string) []string {
    t.Helper()
    out, err := exec.Command("go", "list", "-f", "{{range .Imports}}{{.}}\n{{end}}", pkg).Output()
    if err != nil {
    t.Fatalf("go list %s: %v", pkg, err)
    }
    var internal []string
    for line := range strings.SplitSeq(string(out), "\n") {
    line = strings.TrimSpace(line)
    if strings.HasPrefix(line, "skraak/") || line == "skraak" {
    internal = append(internal, line)
    }
    }
    return internal
    }
  • edit in CLAUDE.md at line 12
    [4.1195618]
    [4.1195618]
    If called by `cmd/`, it goes in `tools/`. If called by `tools/`, it goes in `utils/`.
  • edit in CLAUDE.md at line 20
    [4.7126][4.7126:7222]()
    - **`utils/`** - Reusable helpers (no MCP types, no `*Input`/`*Output` structs, no `db` import)
  • edit in CLAUDE.md at line 21
    [4.7299]
    [4.7299]
    - **`utils/`** - Reusable helpers (no MCP types, no `*Input`/`*Output` structs, no `db` import)
  • edit in .golangci.yml at line 11
    [14.22119]
    [13.488]
    - depguard
  • edit in .golangci.yml at line 35
    [13.1341]
    [13.1341]
    depguard:
    rules:
    # Package dependency rules — see CLAUDE.md "Package Organization"
    # Packages may only import packages below them in the list:
    # cmd → tools, tui, utils, db
    # tools → utils, db
    # tui → tools, utils
    # db → utils
    # utils → (nothing — leaf package)
    utils:
    files:
    - "**/utils/*.go"
    deny:
    - pkg: "skraak/cmd"
    desc: "utils is the leaf package"
    - pkg: "skraak/tools"
    desc: "utils is the leaf package"
    - pkg: "skraak/tui"
    desc: "utils is the leaf package"
    - pkg: "skraak/db"
    desc: "utils is the leaf package"
    db:
    files:
    - "**/db/*.go"
    deny:
    - pkg: "skraak/cmd"
    desc: "db may only import utils"
    - pkg: "skraak/tools"
    desc: "db may only import utils"
    - pkg: "skraak/tui"
    desc: "db may only import utils"
    tui:
    files:
    - "**/tui/*.go"
    deny:
    - pkg: "skraak/cmd"
    desc: "tui must not import cmd"
    - pkg: "skraak/db"
    desc: "tui must not import db"
    tools:
    files:
    - "**/tools/*.go"
    deny:
    - pkg: "skraak/cmd"
    desc: "tools must not import cmd"
    - pkg: "skraak/tui"
    desc: "tools must not import tui"