Re: [PATCH v2] ws: add new tab-between-non-ws check
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jan 8, 2026, 09:01 UTC
- Message-ID
- <dcd87fc4-6514-4146-9e44-1276bd739d2f@kdbg.org>
- In-Reply-To
- <d3f26459-d828-4d01-8c38-ce754e5cc576@kdbg.org>
Am 07.01.26 um 18:33 schrieb Johannes Sixt:
Show 18 quoted lines
> Am 07.01.26 um 02:30 schrieb Adrian Ratiu: >> The check is a bit complex because we want to detect places where >> a SP was intended (HT can expand to more than one display column), >> so we need to count both the display columns (col) and the string >> character columns (i) to determine if a HT looks identical to a SP >> or can cause confusion. >> >> Highlighting support for tools like git diff/show/log is added, as >> well as git apply --whitespace=fix capability. >> >> The middle section of the line used to be assumed non-highlighted, >> which is obviously not true anymore, so we split its logic into a >> separate function named emit_middle_section(). >> >> The new check is enabled for Documentation/**/*.adoc, where these >> kinds of mistakes were seen in practice. It can also be enabled in >> other locations where it can be useful, by adding to the relevant >> attributes file.
This makes me wonder how useful this check is. Yes, I has happened that I didn't spot at TAB that should have been a SP, but perhaps a handful of times in my career. Compare this to the many times that the other kinds of whitespace errors happened.
Applying the rule to all documentation files is questionable: I can't format a table with TAB characters between columns reliably, because if a column happens to be 7 characters wide, the TAB at the 8th position would be diagnosed, but I certainly do *not* want it to be replaced by a SP. Yet, I might want legitimate cases outside tables to be diagnosed, so...
Maybe I'm too much of a devil's advocate here...
-- Hannes