summaryrefslogtreecommitdiff
path: root/src/tools/perlcheck
AgeCommit message (Collapse)Author
2024-03-19Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting ↵Peter Eisentraut
warnings This checks that certain I/O-related Perl functions properly check their return value. Some parts of the PostgreSQL code had been a bit sloppy about that. The new perlcritic warnings are fixed here. I didn't design any beautiful error messages, mostly just used "or die $!", which mostly matches existing code, and also this is developer-level code, so having the system error plus source code reference should be ok. Initially, we only activate this check for a subset of what the perlcritic check would warn about. The effective list is chmod flock open read rename seek symlink system The initial set of functions is picked because most existing code already checked the return value of those, so any omissions are probably unintended, or because it seems important for test correctness. The actual perlcritic configuration is written as an exclude list. That seems better so that we are clear on what we are currently not checking. Maybe future patches want to investigate checking some of the other functions. (In principle, we might eventually want to check all of them, but since this is test and build support code, not production code, there are probably some reasonable compromises to be made.) Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://www.postgresql.org/message-id/flat/88b7d4f2-46d9-4cc7-b1f7-613c90f9a76a%40eisentraut.org
2023-12-20Remove MSVC scriptsMichael Paquier
This commit removes all the scripts located in src/tools/msvc/ to build PostgreSQL with Visual Studio on Windows, meson becoming the recommended way to achieve that. The scripts held some information that is still relevant with meson, information kept and moved to better locations. Comments that referred directly to the scripts are removed. All the documentation still relevant that was in install-windows.sgml has been moved to installation.sgml under a new subsection for Visual. All the content specific to the scripts is removed. Some adjustments for the documentation are planned in a follow-up set of changes. Author: Michael Paquier Reviewed-by: Peter Eisentraut, Andres Freund Discussion: https://postgr.es/m/ZQzp_VMJcerM1Cs_@paquier.xyz
2023-06-21Allow and require passing files on command line of pgperltidyPeter Eisentraut
pgperltidy as well as pgperlcritic and pgperlsyncheck now allow passing files and directories on the command line, like pgindent does. (Previously, they would always operate on the whole tree.) Also, for consistency with pgindent's new behavior (as of b16259b3c1), passing an argument is now required. To get the previous default behavior, use "pgperltidy ." for example. Discussion: https://www.postgresql.org/message-id/flat/45aacd8a-5265-d9da-8df2-b8e2c0cf6a07%40eisentraut.org
2022-11-16doc: update metacpan.org links to avoid redirectsDaniel Gustafsson
The /release/ links are redirected to /dist/ and /pod/release/ to /release/../view/, so update our links accordingly to avoid 301 redirects. Discussion: https://postgr.es/m/CA672723-BAD2-436E-B6E6-163841E11A1B@yesql.se
2022-04-10Fix pgperlsyncheck following SSL TAP test refactoringAndrew Dunstan
Commit 4a7e964fc6 made pgperlsyncheck fail, but apparently nobody noticed, although the buildfarm module that does more or less the same thing was modified. So fix the in-core test. I will look at unifying the two sets of tests so we avoid a future mismatch.
2021-08-31Prohibit map and grep in void contextDaniel Gustafsson
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
2020-04-14Stop requiring an explicit return from perl subroutinesAndrew Dunstan
The consensus of the project appears to be that this provides little benefit and is simply an annoyance. Discussion: https://postgr.es/m/27481.1586618092@sss.pgh.pa.us
2020-04-13Use perl warnings pragma consistentlyAndrew Dunstan
We've had a mixture of the warnings pragma, the -w switch on the shebang line, and no warnings at all. This patch removes the -w swicth and add the warnings pragma to all perl sources missing it. It raises the severity of the TestingAndDebugging::RequireUseWarnings perlcritic policy to level 5, so that we catch any future violations. Discussion: https://postgr.es/m/20200412074245.GB623763@rfd.leadboat.com
2020-04-13Print policy name in perlcritic messagesAndrew Dunstan
This makes it easier to do a web search for details of the policy that's been violated, as well as displaying the name that might be needed for a policy override. Various perlcritic settings changes are being discussed, but this one should be uncontroversial.
2018-06-27Fix whitespacePeter Eisentraut
2018-06-12Exclude files in .git from list of perl filesAndrew Dunstan
The .git directory might contain perl files, as hooks, for example. Since we have no control over these they should be excluded from things like our perlcritic checks. Per offline report from Mike Blackwell.
2018-06-11Move perlcritic files to new perlcheck directoryAndrew Dunstan
2018-06-11Add a script to detect perl compile time errors and warningsAndrew Dunstan
Also add a function that centralizes the logic for locating all our perl files and use it in pgperlcritic and pgperltidy as well as the new pgperlcheck.