Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9FjR-000vHV-7H for pgsql-hackers@arkaria.postgresql.org; Tue, 21 May 2024 03:00:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s9FjR-0072Pg-6o for pgsql-hackers@arkaria.postgresql.org; Tue, 21 May 2024 03:00:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9FjQ-0072PW-Tc for pgsql-hackers@lists.postgresql.org; Tue, 21 May 2024 03:00:04 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s9FjN-001ICV-OC for pgsql-hackers@postgresql.org; Tue, 21 May 2024 03:00:04 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-52232d0e5ceso4629014e87.0 for ; Mon, 20 May 2024 20:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716260402; x=1716865202; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GZJgH6UgyPtCcH8Mb/4MD/q970EjCJ5Jd2rcL4nCfVc=; b=MAtU4sjo3WaOOS34UlB4akSDssMxxU6ge1UeE8wPzLb96sjx7pjC/VAmZMCA6SJ9Ux PUj0G3Y0Y2WmdUQAjNDJQqClv2YqDivW14P6rfO/COnI1Q/KvtJhNNyom43ZA/s2c5aq CTIDi0/8/ijKmd3aNXXTCd2xXD/WdPrpeMSEdPhLH4h/rJOXCWE+3rzvcvWvo1a/AiFg u2+GJCr1bPyHo+x9AAArfYMmhFkXKjqmb86x4tsu2FDs2HYPgH9nCrEwFSrOte+n6ZN8 qROm8ancE+HHibxpcGgTCmUnjzZDx0ThGdjw0QgHj7+hziW7Po0mzaPgsBNhEDGPBDyM 0wIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716260402; x=1716865202; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GZJgH6UgyPtCcH8Mb/4MD/q970EjCJ5Jd2rcL4nCfVc=; b=BTldHiIDIrfcrKBor1vE4mnx5lT4aLaQEH9wrlpBLuJqSjY9aiockuFwU0N6Gn0P2R rw1VkQFdj8rxe5odTgTOPramfZUxiFFoqxA0QmjQnjkAmlJOpaeKQ8oF+cp1Y01HndTp s+vJhCQKWHV1u6sKBvWewLaB9eWSk/xQxu02QkmhY2jubBMl+CAhdOSqRAna/s5/x/2b nYcEkOwT66D1hMsYcCnp2cnNKl7YJ6DDp55LDDsgXvunLfFu74DyufuvBzBTudXvW4b4 PUCWb4olZ7nJR/kLoovFsvVLQ3YVP6s1uMgdRCwYOdfqKNExWGR16ISIaBNgXlDx7teV aFDA== X-Gm-Message-State: AOJu0YwrVERkwdJ23FFaoc3p1Ha/bcWYhIOC33/lXTxftOa9xXmOi/Hr eKkgK5miZKRVySkVbakq9MNYuJQS8MlOEZn0igchuagBemPE630x X-Google-Smtp-Source: AGHT+IEIp24oZ87aJL2t/XzcB/9BCibrWyhc6FfvEYbUfzOv3zKxn8L4pPN9PwhMZGQsg1ja6+QIQA== X-Received: by 2002:a05:6512:e94:b0:521:cee5:db36 with SMTP id 2adb3069b0e04-52210074834mr23706473e87.48.1716260401641; Mon, 20 May 2024 20:00:01 -0700 (PDT) Received: from [1.0.0.7] ([178.155.29.29]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f39d2bb6sm4522041e87.249.2024.05.20.20.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 May 2024 20:00:01 -0700 (PDT) Message-ID: <730c8376-77db-5af6-ea2f-d530f68c5fa3@gmail.com> Date: Tue, 21 May 2024 06:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Cleaning up perl code Content-Language: en-US To: =?UTF-8?Q?Dagfinn_Ilmari_Manns=c3=a5ker?= Cc: pgsql-hackers References: <70b340bc-244a-589d-ef8b-d8aebb707a84@gmail.com> <87ttisfcah.fsf@wibble.ilmari.org> From: Alexander Lakhin In-Reply-To: <87ttisfcah.fsf@wibble.ilmari.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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