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

Aperta Adatta ai principianti
#444 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
security

Direzione di ricerca

Individua il pattern wildcard EA1 e i test esistenti per i grant su una singola riga, quindi esegui la matrice completa dei grant descritta nell’issue, includendo i casi di note a piè di pagina e righe vuote. Il lavoro è completato quando questi esempi benigni di documentazione non corrispondono più, mentre le forme di grant tra virgolette, tra parentesi quadre, bare, senza spazi, con tabulazione, CRLF, in maiuscolo e con commento finale continuano a corrispondere.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
24.4k
Fork
2.1k
Merge medio
4g 22h
PR unite (30g)
116

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/SkillSpector

Tutte le issue di NVIDIA/SkillSpector

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.