mattlqx / pre-commit-search-and-replace

Plugin for pre-commit for arbitrary search and replace on committed files.
MIT License
12 stars 7 forks source link

insensitive arg from pre-commit-config? #10

Closed christianbirzer-horsch closed 6 months ago

christianbirzer-horsch commented 2 years ago

Hi, It would be great to have a way to pass other arguments than search and replace directly from the pre-commit-config file. I'd like to make the search case insensitive but could not get it to work without using the pre-commit-search-and-replace config file.

I'd like to do something like this from my pre-commit-config.yaml:

    hooks:
    -   id: search-and-replace
        args: [ --search, "Remove before flight", --insensitive ]
    -   id: search-and-replace
        args:  [ --search, "fixme", --insensitive ]

I found out that it seems not to be a probem from the command line but the insensitive switch seems to work for simple searches not at all. Only for regex. Since the doc states an example for using a simple search without a regex and the insensitive option I'd consider this as bug - either in the program or at least in the documentation ;-)

mattlqx commented 6 months ago

Fixed in v1.1.0. Thanks for the flagging (years ago!).