Warn when using deprecated rgrep #2657
Open
+6
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Just as
egrepandfgrephave been deprecated by both the POSIX and GNU versions of grep, Debian has deprecated thergrepcommand 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
egrepandfgrephave already been removed upstream?), even though it also removes the deprecation warning fromegrepandfgrep(rgrepnever had one).This PR adds a new rule, SC2324, which is identical to SC2196 and SC2197 save that it targets
rgrep. As a bonus,rgrephas also been added to the list of greps for which-qshould be suggested (SC2143).It probably also makes sense to add all three variants to SC2126 (piping grep to
wc -lwhengrep -ccould 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.