From: Bruce Momjian <bruce@momjian.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Perl scripts: eliminate "Useless interpolation" warnings
Date: Sun, 15 Sep 2024 16:16:52 -0400
Message-ID: <ZudAtNRQOkveAa91@momjian.us> (raw)
In-Reply-To: <66b5b1d6-3f2a-4944-91a3-7e40a565ccac@dunslane.net>
References: <E1spqfS-001Ehn-Cx@gemulon.postgresql.org>
<66b5b1d6-3f2a-4944-91a3-7e40a565ccac@dunslane.net>
On Sun, Sep 15, 2024 at 02:30:47PM -0400, Andrew Dunstan wrote:
>
>
> On 2024-09-15 Su 10:56 AM, Bruce Momjian wrote:
>
> Perl scripts: eliminate "Useless interpolation" warnings
>
> Eliminate warnings of Perl Critic from src/tools.
>
> Backpatch-through: master
>
>
>
> I don't understand this commit. The buildfarm members crake and koel regularly
> run the perl critic checks and have not complained. See for example from before
> this change: <https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=
> koel&dt=2024-09-15%2003%3A34%3A02&stg=perl-check>
>
> The change doesn't seem to have had any discussion either. This particular
> warning is surely a very low level (i.e. fairly unimportant) one, of the type
> we normally ignore. If some version of perlcritic has raised it to severity 5
> then the correct action IMNSHO would be to add an exception for it to the
> perlcriticrc, like we do for ProhibitLeadingZeros. If not, then perhaps you can
> explain how you got the warnings.
So, the warning is about the use of double-quotes when single-quotes
will work just fine. I wrote a new script and changed it to single
quotes, so for consistency, I looked at other Perl scripts that might
have the issue. The message I got was:
/root/add_commit_links.pl: Useless interpolation of literal string at line 51 near 'my $tmpfile = $file . ".tmp";'. (Severity: 1)
My $HOME/.perlcritic has:
severity = 1
and that is why I saw it. Is it a bad change?
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
When a patient asks the doctor, "Am I going to die?", he means
"Am I going to die soon?"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: bruce@momjian.us, andrew@dunslane.net, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Perl scripts: eliminate "Useless interpolation" warnings
In-Reply-To: <ZudAtNRQOkveAa91@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox