Skip to content

Make Config.Validate() functional or remove it #13

@Fuabioo

Description

@Fuabioo

Problem

The Config.Validate() method always returns nil, making it a no-op.

Evidence

config.go:150-157

func (c *Config) Validate() error {
    if _, err := os.Stat(c.ProjectsDir); os.IsNotExist(err) {
        return nil  // Not an error - returns nil even when dir doesn't exist
    }
    return nil  // Always nil
}

The method is named Validate but doesn't validate anything - it always returns nil regardless of input.

Impact

  • Misleading API - callers expect validation to occur
  • Future maintainers might add calls to Validate() expecting it to work
  • Defensive programming relies on validation actually validating

Suggested Fix

Either:

  1. Make it validate something useful, such as:
    • Check if ClaudeBin exists and is executable
    • Verify DBPath parent directory is writable
    • Validate Backend is a known value
  2. Remove the method entirely if validation isn't needed

Files: internal/config/config.go:150-157

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions