Closed mattdeutsch closed 2 years ago
Hey, no, it's not a feature. The script just gets changed filenames passed to it by pre-commit. It's much the same way that linters typically operate on the whole file though, not just the bits that have changed. It'd probably be possible to do a git diff and find line ranges that were changed, but it does increase the complexity a bit.
Unfortunate - thanks for the quick response!
Currently, running this hook on a file you've changed some of will run the search-and-replace functionality on the whole file. It would be preferable to have it only check the additions that are in the diff. Is there a toggle to have it only check the diff that I've missed?