Prohibit map and grep in void context
Daniel Gustafsson <dgustafsson@postgresql.org>
Prohibit map and grep in void context map and grep are not intended to be used as mutators, iterating with side-effects should be done with for or foreach loops. This fixes the one occurrence of the pattern, and bumps the perlcritic policy to severity 5 for the map and grep policies. Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Andrew Dunstan <andrew@dunslane.net> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Discussion: https://postgr.es/m/87fsvzhhc4.fsf@wibble.ilmari.org
Files
| Path | Change | +/− |
|---|---|---|
| contrib/intarray/bench/create_test.pl | modified | +1 −1 |
| src/tools/perlcheck/perlcriticrc | modified | +7 −0 |
Discussion
- perlcritic: prohibit map and grep in void conext 14 messages · 2021-07-27 → 2021-08-31