Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

fix(performance): match complexity-share registry globs per path segment, not with fnmatch

Geschlossen
#6,983 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Ein zugehöriger Pull Request wurde bereits gemerged.

  • #7080 von @kyle-sexton — gemerged

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
tooling

Rechercherichtung

Start with registry_key and the fnmatchcase call in scripts/js-complexity-share.py (around lines 72-74), which exist only on the PR #6806 branch, not main. Compare them with the pathglob matcher in plugins/code-metrics/skills/audit-duplication/scripts/registry-filter.py. Done means a member glob like plugins/*/hooks/x.js no longer matches nested paths, both tools agree on the same registry file, and a test covers a nested path that must not match.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

needs-human needs-triage

Summary

scripts/js-complexity-share.py, added by PR #6806 (not yet on main; the evidence below is pinned to that branch), matches registry cluster members with fnmatch.fnmatchcase. In fnmatch, * matches any characters including /, so a member glob such as plugins/*/hooks/x.js also matches nested paths, and a registry line can sanction more files than it names. The sibling registry reader in the code-metrics plugin uses the gitignore-style pathglob matcher, where * does not cross /.

Failure scenario

Expected: a cluster member glob matches the same set of files here as it does in registry-filter.py, so both tools agree on what counts as a sanctioned copy.

Actual: a member glob with * matches deeper paths here. Files that the registry does not intend to sanction collapse into the cluster and are counted once, which lowers the measured share and loosens the ratchet. The two tools can also disagree on the same registry file.

Evidence

Pinned to the head of PR #6806, branch js-complexity-share-ratchet, commit 108b03fb37d24ca04ea8d6d5d1527b0a596f8531:

Suggested fix

Reuse pathglob.matches from the code-metrics plugin, or implement segment-aware matching, so * stops at / and ** is explicit. Add a test with a member glob and a nested path that must not match.

Related

  • PR #6806

🤖 Generated with Claude Code

Vorherrschende Sprache
Shell
Sterne
22
Forks
2
Ø Merge
8 Std. 24 Min.
Gemergte PRs (30 T.)
947

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus melodic-software/claude-code-plugins

Alle Issues in melodic-software/claude-code-plugins

Ähnliche Issues

Weitere Issues zu Shell/Bash

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.