Andreas Tille:
Package: dh-debputy
Version: 0.1.93
Severity: normal
X-Debbugs-Cc: [email protected]
Hi,
there is a call of
debputy lint --auto-fix
integrated into routine-update and this works nicely in many cases.
Thanks a lot for this helpful tool.
Thanks, I am glad it is helpful in general.
Unfortunately it seems to be a bit
to aggressive in "fixing" things. I recently worked on horizon-eda where
some overrides where deliberately renamed to deactivate these by the
maintainer.
[...]
While override_dh_auto_install did not break the build the change to
override_dh_auto_build was unfortunate. Thinking about it I would have
preferred that this would not have been "fixed".
[...]
Kind regards
Andreas.
[...]
The check / fix in question is a typo-fix using edit-distance.
Edit-distance-wise `__` is the same as a character swap (`ts` -> `st`).
Honestly, I feel the proper solution is to rely on `git` to be able to
restore the targets if needed. "Disabling" them like this is in my view
similar to `git mv foo foo.bak` and committing foo.bak.
Also if the prefix had been a few characters longer, the edit distance
had become too great for the typo detection to find it. So
`disabled_dh_auto_install` had worked as intended. Alternatively, if the
target had been properly commented out, it also would not have caused
issues.
I am open to special-casing `_` as a prefix to skip the typo-logic as it
is very unlikely that someone typos it by adding a prefix (prefix is
always `exec...` or `over...`. Neither has `_` close by on qwert[yz] at
least). But I think this is about as good as heuristics can get for the
".bak"-equivalent of disabling rules files. It is hard to tell a "I
typoed this by mistake" vs. "I deliberately typoed it to disable it"
apart in general.
Unless you have other proposals for heuristics or counter arguments,
then I expect to close it with that change. That is, it will be less
likely to occur but someone can still construct a way to deliberately
typo it with the intent to disable it, which `debputy` mistakes for an
unintentional typo.
Best regards,
Niels