Skip to content

refactor: replace hand-rolled string search with strings.Contains in status.go #21

@jpleva91

Description

@jpleva91

Problem

internal/status/status.go implements contains() and searchString() functions that manually iterate over runes to check substring containment. This is a reimplementation of strings.Contains() from the standard library — unnecessary code that adds maintenance surface.

Acceptance Criteria

  • Replace contains(s, substr) calls with strings.Contains(s, substr)
  • Replace containsChitin(data) to use strings.Contains(string(data), "chitin")
  • Remove the contains() and searchString() functions
  • Verify strings is already imported (it is not — add the import)
  • All existing tests still pass
  • go vet ./internal/status/... passes

Hints

  • File: internal/status/status.go
  • Lines 137-154: containsChitin(), contains(), searchString()
  • containsChitin is called by checkClaudeHooks() and checkCopilotHooks()
  • This is a safe 1:1 replacement — strings.Contains has identical semantics

Generated by /forge fill

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions