shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

Warn when using deprecated rgrep

Open benblank opened this issue 2 years ago • 2 comments

Just as egrep and fgrep have been deprecated by both the POSIX and GNU versions of grep, Debian has deprecated the rgrep command it injects into the GNU grep package they distribute. (Which Ubuntu inherits, as well.)

The patches applied by Debian now list all three as deprecated (though all three are also listed as "Debian-specific", so perhaps egrep and fgrep have already been removed upstream?), even though it also removes the deprecation warning from egrep and fgrep (rgrep never had one).

This PR adds a new rule, SC2324, which is identical to SC2196 and SC2197 save that it targets rgrep. As a bonus, rgrep has also been added to the list of greps for which -q should be suggested (SC2143).

It probably also makes sense to add all three variants to SC2126 (piping grep to wc -l when grep -c could be used instead), but I didn't discover that until I was typing up this description and my (fairly limited) Haskell skills aren't up to doing it quickly. 😅 If others agree that it should be done though, I'll happily make the change when I have more time in the next few days.

benblank avatar Jan 08 '23 22:01 benblank

already be changed

I'll have to take your word for it — I'm still working my way though figuring out the code structure. 😉

benblank avatar Jan 15 '23 20:01 benblank

It's a two step process. see below:

2023-01-16_07-14

port19x avatar Jan 16 '23 06:01 port19x