- Notifications
You must be signed in to change notification settings - Fork1.9k
Warn when using deprecated rgrep#2657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
port19x left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good.
Suggessting-c foregrep,fgrep,rgrep orzgrep would be a bad idea.
Assuming shellcheck compliance, those instances of.{1}grep | wc -l will already be changed to standardgrep -c due to the SC2324 you extend here.
benblank commentedJan 15, 2023
I'll have to take your word for it — I'm still working my way though figuring out the code structure. 😉 |
port19x commentedJan 16, 2023
50074dc toeac8effCompare
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 nowlist all three as deprecated (though all three are also listed as "Debian-specific", so perhaps
egrepandfgrephave already been removed upstream?), even though it alsoremoves the deprecation warning fromegrepandfgrep(rgrepnever had one).This PR adds a new rule, SC2324, which is identical toSC2196 andSC2197 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 toSC2126 (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.