Skip to content

small fixes#14

Closed
piqoni wants to merge 1 commit intomainfrom
testing_reviewer
Closed

small fixes#14
piqoni wants to merge 1 commit intomainfrom
testing_reviewer

Conversation

@piqoni
Copy link
Owner

@piqoni piqoni commented Oct 6, 2025

testing reviewer

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

∇ Vogte Code Review

Summary:

  • Two small changes introduce a compile-time error and a breaking CLI change. Risk is high for build failure and backwards compatibility.

Findings:

  • [Severity: High] main.go:~line 15 — Undefined variable used
    Explanation: You renamed the local variable to Pwd but the later flag default still references pwd. This will not compile.
    Suggestion:

    • Either revert to lowercase or update the usage consistently. Prefer idiomatic lowercase for local vars.
      Example fix:
    pwd, err := os.Getwd()
    if err != nil {
        log.Fatalf("Failed to get current working directory: %v", err)
    }
    // ...
    dirPtr := flag.String("dir", pwd, "The directory to analyze")
  • [Severity: High] main.go:~line 23 — CLI flag name typo breaks compatibility
    Explanation: The flag key changed from "model" to "m0del" (with zero), likely a typo. This silently breaks existing users/scripts expecting -model.
    Suggestion:

    • Restore the flag name to "model".
      Example fix:
    modelPtr := flag.String("model", "", "LLM model name (overrides config)")
  • [Severity: Low] main.go:~line 15 — Non-idiomatic capitalization
    Explanation: Capitalizing a local variable (Pwd) is non-idiomatic in Go and suggests export, which isn’t applicable in a function scope.
    Suggestion:

    • Use lowercase (pwd) for local variables.

Additional suggestions:

  • Add a simple build/test step in CI to catch compile errors like the undefined variable.
  • Consider a basic test or a small refactor to make flag parsing testable (e.g., a parseFlags function using a FlagSet) to verify expected flags like -model.

Verdict: Needs attention

This review was automatically generated by vogte

@piqoni
Copy link
Owner Author

piqoni commented Oct 6, 2025

/vogte-review

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

∇ Vogte Code Review

Summary:

  • The change introduces a compile-time error and a breaking CLI flag change likely due to a typo. Risk is high.

Findings:

  • [Severity: High] main.go:~line 14 — Undefined variable due to rename
    Explanation: The local variable pwd was renamed to Pwd, but subsequent usage still references pwd in flag.String("dir", pwd, ...). This will not compile (undefined: pwd).
    Suggestion: Either revert to the idiomatic lowercase name or update all references consistently. Prefer keeping it lowercase for local vars.
    Quick patch:

    pwd, err := os.Getwd()
    if err != nil {
        log.Fatalf("Failed to get current working directory: %v", err)
    }
    dirPtr := flag.String("dir", pwd, "The directory to analyze")
  • [Severity: High] main.go:~line 20 — Breaking CLI flag name change ("model" -> "m0del")
    Explanation: The flag name was changed from "model" to "m0del" (with a zero). This breaks backward compatibility and appears to be a typo. Existing users/scripts using -model will stop working.
    Suggestion: Revert to "model". If you need to support both temporarily, register both names pointing to the same variable and mark the incorrect one as deprecated.
    Quick patch (preferred):

    modelPtr := flag.String("model", "", "LLM model name (overrides config)")

    Optional compatibility shim (if "m0del" has already shipped):

    modelPtr := flag.String("model", "", "LLM model name (overrides config)")
    flag.StringVar(modelPtr, "m0del", "", "Deprecated: use -model")
  • [Severity: Low] main.go:~line 12 — Non-idiomatic local variable capitalization
    Explanation: Using capitalized Pwd for a local variable is non-idiomatic in Go and implies export, which doesn’t apply in function scope.
    Suggestion: Keep local vars lowercase (pwd or cwd).

Tests:

  • Add a small integration test or script that runs the binary with -model foo and asserts the value is observed, and that -dir defaults to the current working directory when not provided.
  • Consider a simple build CI step to catch compile errors on PR.

Verdict: Needs attention

This review was automatically generated by vogte

@piqoni piqoni closed this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant