EA1: wildcard pattern still false-positives on footnote-legend '*' and on blank lines before the colon

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

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
security

調査の方向性

EA1 の wildcard パターンと既存の単一行 grant テストを見つけ、その後、issue に記載された完全な grant マトリックスを、脚注と空行のケースを含めて実行します。完了とは、これらの無害なドキュメント例がもはやマッチせず、引用符付き、角括弧付き、bare、スペースなし、タブ、CRLF、大文字、末尾コメント付きの grant 形式は引き続きマッチすることです。

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

説明

Summary

Follow-up to #405 / #417. The single-line + standalone-* fix killed the markdown-bold and cross-heading false positives, but two false-positive paths remain in the EA1 wildcard pattern:

(r"(?:tools?|permissions?)\s*:[ \t]*\[?[ \t]*['\"]?\*(?!\*|\w)['\"]?[ \t]*\]?", 0.85)

Case 1: footnote/legend text still matches

The (?!\*|\w) lookahead only rejects a * followed by another * or a word character. A standalone * followed by a space passes — and documentation legitimately uses a bare * as a footnote marker after a label:

Tools: * = requires authentication
Tools: * marks optional parameters

Both match today (verified with re.IGNORECASE | re.MULTILINE, matched text Tools: * ) and fire EA1/MEDIUM on benign docs — same class of false positive as #405.

Case 2: the gap before the colon still crosses blank lines

#417 bounded the whitespace after the colon to [ \t]*, but the \s* before the colon still matches newlines. A line ending in tools/permissions followed by a blank line and a markdown definition-list line starting with : still bridges paragraphs:

several tools

: * item

Matched text: tools\n\n: * — the same cross-paragraph disease #405 reported, on the other side of the colon.

Proposed fix

  • Bare (unquoted) * should only count when it ends the line (optionally followed by ] and/or a # comment): a real bare-scalar grant has nothing after the value, a footnote legend always does. Quoted forms ("*", '*') stay as-is — they are unambiguous.
  • Bound the pre-colon gap to the same line: [ \t]*: instead of \s*:. No real YAML/JSON/TOML syntax puts a newline between a key and its colon.

Verified against the full single-line grant matrix (quoted, bracketed, bare, no-space, tab, CRLF, uppercase, trailing comment): no genuine form is lost.

主要言語
Python
スター
23.2k
フォーク
2k
平均マージ
5日 12時間
マージ済み PR(30日)
122

環境構築

はじめの一歩

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

NVIDIA/SkillSpector のほかの issue

NVIDIA/SkillSpector の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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