fix(markdown-format): pre-commit hooks rewrite and lint untouched lines of a staged file
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- markdown, shell
- Bereich
- testing-qa, tooling
Rechercherichtung
Start with plugins/markdown-format/git-hooks/format.sh and lint.sh, then trace how each hook identifies and processes staged Markdown files. Reproduce the reported behavior with a staged append to a file containing existing formatter drift and MD037 findings. Done means the hooks handle only changed lines or otherwise preserve untouched text while allowing the append to pass.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Steps to reproduce
- In a repository that loads
lefthook-remote.ymlfrom this repository (melodic-software/architecture does), take a markdown file that already has formatter drift or lint findings on lines nobody is changing.docs/owner-decisions.mdhas two: rows 49 and 53 containBash(git *), which the formatter rewrites, and markdownlint reports MD037 on them. - Append one line to the file, stage it and commit.
Expected behavior
The commit judges only the lines the change touches. An append-only record such as docs/owner-decisions.md can take a new row without its earlier rows changing.
Actual behavior
markdown-format-remote-format (plugins/markdown-format/git-hooks/format.sh) formats the whole staged file and rewrites rows 49 and 53 from Bash(git *) to Bash(git*). markdown-format-remote-lint (plugins/markdown-format/git-hooks/lint.sh) then fails the commit on MD037 in rows that are not part of the change. In melodic-software/architecture#266 the rewrite changed a recorded permission grant in an owner-decision row. A review bot flagged it, and the rows had to be restored by hand in a commit made outside the hook. Skipping the job is not allowed for agents, so an agent cannot append to that file at all.
Severity
Medium
Severity justification
It blocks every agent commit to an append-only record that holds pre-existing drift. The rewrite also silently changes recorded text (a permission string) unless a reviewer notices it. A manual workaround exists (an owner commit), and no data is lost when the rewrite is caught.
Suggested fix location
plugins/markdown-format/git-hooks/format.sh and lint.sh: judge and format only the staged hunks' lines (for example, report lint findings only on changed lines and refuse to rewrite unchanged lines), or let a repository mark files as append-only so that the hooks check only the added lines.
Environment
melodic-software/architecture at bb7e42a with the remote config from claude-code-plugins main; observed 2026-11-25.
- Vorherrschende Sprache
- Shell
- Sterne
- 22
- Forks
- 2
- Ø Merge
- 2 Std.
- Gemergte PRs (30 T.)
- 960
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus melodic-software/claude-code-plugins
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
melodic-software/claude-code-plugins#19225 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
melodic-software/claude-code-plugins#17779 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
recurring
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
melodic-software/claude-code-plugins#19274 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
melodic-software/claude-code-plugins#19270 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 53/100
melodic-software/claude-code-plugins#19269 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in melodic-software/claude-code-plugins
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
CachyOS/CachyOS-Welcome#307 ·
-
Magnet links and .torrent files not opened: desktop Exec lacks %U and biglybt-runner drops argumentsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
area:linux source:reader type:enhancement
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
stephrobert/blog-roadmap#236 ·
-
[BUG][Windows] mo clean throws Int32 overflow in Developer tools when removed size exceeds 2 GiBOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
nais/attest-sign#139 ·
Maintainer antworten meist innerhalb von 1 Tag