fix(markdown-format): pre-commit hooks rewrite and lint untouched lines of a staged file
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- markdown, shell
- Domain
- testing-qa, tooling
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Shell
- Stars
- 22
- Forks
- 2
- Avg merge
- 2h
- Merged PRs (30d)
- 960
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from melodic-software/claude-code-plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melodic-software/claude-code-plugins#19225 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
melodic-software/claude-code-plugins#17779 · 2 comments ·
Maintainers usually reply within 1 day
-
recurring
Difficulty 4/5 3-5 days Newbie friendliness 25/100
melodic-software/claude-code-plugins#19274 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
melodic-software/claude-code-plugins#19270 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 53/100
melodic-software/claude-code-plugins#19269 ·
Maintainers usually reply within 1 day
All issues in melodic-software/claude-code-plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nais/attest-sign#139 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
community-scripts/core#303 ·
Maintainers usually reply within 1 day
-
severity: low
Difficulty 1/5 Under an hour Newbie friendliness 72/100
luainkernel/lunatik#2727 ·
Maintainers usually reply within 1 day
-
[quality] release publish.mjs integrity guards have no unit testPossibly taken @robarnold claimed this today. Openagent/quality stage/040-covered-by-pr testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
marinatedconcrete/config#1155 ·
Maintainers usually reply within 1 day
-
bug report-to-upstream
Difficulty 1/5 Under an hour Newbie friendliness 75/100
flatpark/flatpark#1585 · 1 comment ·
Maintainers usually reply within 1 day