Summary
Text output renders the position prefix as <line>:<line>:<column>: instead of the conventional <line>:<column>:. Every finding shows the line number twice.
Repro
$ cat sedcheck.sh
#!/usr/bin/env bash
sed -i 's/still/broken/' file.txt
$ macbash sedcheck.sh
sedcheck.sh
2:2:1: ERROR [sed-inplace-no-backup]
The finding is on line 2, column 1. The prefix should read 2:1:.
Cause
src/output.rs writes the line number once as a styled field and then again in the plain format string:
self.write_styled(gray(), &format!("{}", m.line))?;
write!(self.w, ":{}:{}: ", m.line, m.column)?;
Not a port regression
The Go implementation macbash replaced had the identical bug -- fmt.Fprintf(f.writer, " %s:%d:%d: ...", color(gray, m.Line), m.Line, m.Column). The Rust port reproduced it faithfully. So this is an inherited upstream defect, not something the rewrite introduced.
Why it needs a decision, not just a patch
The Rust rewrite's acceptance bar was byte-for-byte behavioural parity with the Go binary (see docs/decisions/0001-rewrite-macbash-in-rust.md), and macbash is intended to replace the upstream repo. Fixing the prefix is a user-visible text-output change:
--format json is the documented stable contract and is unaffected -- it carries line and column as separate fields.
- Text output is explicitly NOT a contract (README, ARCHITECTURE.md), so nothing formally breaks.
- But anything grepping the text output for
^ N:N: would need updating.
Suggested fix
self.write_styled(gray(), &format!("{}", m.line))?;
write!(self.w, ":{}: ", m.column)?;
That keeps the grey styling on the line number and produces 2:1:, matching every other linter's file:line:col convention.
Also worth adding an integration-test assertion on the prefix shape so it cannot silently regress again.
Summary
Text output renders the position prefix as
<line>:<line>:<column>:instead of the conventional<line>:<column>:. Every finding shows the line number twice.Repro
The finding is on line 2, column 1. The prefix should read
2:1:.Cause
src/output.rswrites the line number once as a styled field and then again in the plain format string:Not a port regression
The Go implementation macbash replaced had the identical bug --
fmt.Fprintf(f.writer, " %s:%d:%d: ...", color(gray, m.Line), m.Line, m.Column). The Rust port reproduced it faithfully. So this is an inherited upstream defect, not something the rewrite introduced.Why it needs a decision, not just a patch
The Rust rewrite's acceptance bar was byte-for-byte behavioural parity with the Go binary (see
docs/decisions/0001-rewrite-macbash-in-rust.md), and macbash is intended to replace the upstream repo. Fixing the prefix is a user-visible text-output change:--format jsonis the documented stable contract and is unaffected -- it carrieslineandcolumnas separate fields.^ N:N:would need updating.Suggested fix
That keeps the grey styling on the line number and produces
2:1:, matching every other linter'sfile:line:colconvention.Also worth adding an integration-test assertion on the prefix shape so it cannot silently regress again.