pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Cleaning up perl code
Date: Tue, 21 May 2024 06:00:00 +0300
Message-ID: <730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com> (raw)
In-Reply-To: <87ttisfcah.fsf@wibble.ilmari.org>
References: <70b340bc-244a-589d-ef8b-d8aebb707a84@gmail.com>
	<87ttisfcah.fsf@wibble.ilmari.org>

Hello Dagfinn,

Thank you for paying attention to it and improving the possible fix!

20.05.2024 23:39, Dagfinn Ilmari Mannsåker wrote:
> Nice cleanup!  Did you use some static analysis tool, or did look for
> them manually?

I reviewed my collection of unica I gathered for several months, but had
found some of them too minor/requiring more analysis.
Then I added more with perlcritic's policy UnusedVariables, and also
checked for unused subs with a script from blogs.perl.org (and it confirmed
my only previous find of that kind).

>   If I add [Variables::ProhibitUnusedVariables] to
> src/tools/perlcheck/perlcriticrc, it finds a few more, see the attached
> patch.

Yes, I saw unused $sqlstates, but decided that they are meaningful enough
to stay. Though maybe enabling ProhibitUnusedVariables justifies fixing
them too.

> The scripts parsing errcodes.txt really should be refactored into using
> a common module, but that's a patch for another day.

Agree, and I would leave 005_negotiate_encryption.pl (with $node_conf,
$server_config unused since d39a49c1e) aside for another day too.

Best regards,
Alexander





view thread (11+ messages)  latest in thread

Message-ID: <730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com>
Permalink:  ../730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com/
Also on:    postgresql.org/message-id/730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, ilmari@ilmari.org
  Subject: Re: Cleaning up perl code
  In-Reply-To: <730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com>
  References: <70b340bc-244a-589d-ef8b-d8aebb707a84@gmail.com> <87ttisfcah.fsf@wibble.ilmari.org> <730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com>

* 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