search_files strips leading whitespace from matched lines

Open Beginner friendly
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
search

Research direction

Start in internal/searchfiles/searchfiles.go, where matched lines are processed before the file:line:match output is formatted. Review internal/searchfiles/searchfiles_test.go and add coverage showing that leading indentation and trailing spaces are retained, then run the searchfiles tests to verify the raw matched line is preserved.

Written by the indexing model from the issue text.

Description

bug

Background

internal/searchfiles/searchfiles.go uses strings.TrimSpace on matched lines before formatting the file:line:match output. This removes indentation, which is significant for code searches.

Expected behavior

The raw matched line should be preserved in the output so indentation and trailing spaces are retained.

Files to change

  • internal/searchfiles/searchfiles.go
  • internal/searchfiles/searchfiles_test.go

Related

PR #102 (Phase 2 OpenClaw/Hermes tool compatibility)

Dominant language
Go
Stars
2
Forks
1
Avg merge
6h 9m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from redhat-et/docsclaw

All issues in redhat-et/docsclaw

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.