Search files catch and hint when search looks like regex

オープン 初心者向け
#75 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli, tooling

調査の方向性

internal/tools/search.go と internal/tools/search_test.go のテストを読み、search_files が一致なしをどのように処理するか確認してください。一致がない場合と、パターンがファイルに一致する場合の両方について、| を含むパターンのテストを追加してください。一致がない場合の応答に先頭の「error」を付けずにプレーンテキスト検索のヒントが示され、一致した場合は引き続き通常どおり返され、make check が成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

good first issue tools

What

search_files matches plain text on purpose, because small models write regex that is broken or matches the wrong thing. However they might still send regex. For now we want to detect if the model is trying to send regex and push it to instead send plain text matching.

Where

  • internal/tools/search.go
  • internal/tools/search_test.go

Fix

When there are no matches and the pattern contains |, add a hint to the reply, for example:

no matches for "a|b". The pattern is plain text, not a regex: "|" is searched for literally. Search for one word at a time instead.

Keep the reply free of a leading "error". Finding nothing is a valid answer, and it must not trip the guard in internal/agent that stops runaway tool loops.

Done when

  • A pattern containing | with no matches returns the hint.
  • A pattern containing | that does match (it really is in a file) returns the matches normally, with no hint.
  • Tests are added in internal/tools/search_test.go.
  • make check passes.
主要言語
Go
スター
1
フォーク
2
平均マージ
12時間 55分
マージ済み PR(30日)
18

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Edwin-metcalf/MetCode のほかの issue

Edwin-metcalf/MetCode の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。