From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9B18A6CFF1 for ; Wed, 31 Mar 2021 14:33:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 90BF4F823 for ; Wed, 31 Mar 2021 14:33:58 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 01B50F817 for ; Wed, 31 Mar 2021 14:33:57 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C3D4042F71 for ; Wed, 31 Mar 2021 14:33:56 +0200 (CEST) Message-ID: <710bac68-6ff0-892d-111a-eed88f456f2c@proxmox.com> Date: Wed, 31 Mar 2021 14:33:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Thunderbird/88.0 Content-Language: en-US To: Proxmox VE development discussion , Stefan Reiter , Oguz Bektas References: <20210330122310.1117492-1-o.bektas@proxmox.com> From: Thomas Lamprecht In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.044 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, perl.org] Subject: Re: [pve-devel] [RFC v2 storage] smartctl: use json parsing X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2021 12:33:58 -0000 did not looked at all, so just a single comment. On 31.03.21 14:06, Stefan Reiter wrote: >> +=C2=A0=C2=A0=C2=A0=C2=A0my=C2=A0$wearout=C2=A0=3D=C2=A0100.0=C2=A0-=C2= =A0$json_result->{nvme_smart_health_information_log}->{percentage_used}=C2= =A0if=C2=A0!$healthonly; >=20 > too=C2=A0long=C2=A0even=C2=A0for=C2=A0my=C2=A0liking,=C2=A0needs=C2=A0a= =C2=A0line=C2=A0break=C2=A0somewhere=C2=A0:) Yeah, there's more to it... 1. I explicitly wrote a "Wrapping Post-If" section for the last time some= body (*wink*) used it: https://pve.proxmox.com/wiki/Perl_Style_Guide#Wrappin= g_Post-If 2. `my $foo =3D "bar" if !$baz` is a bug! From the s "Also remember that you must NOT use post if when declaring the varia= ble for the first time with my!"=20 -- end of https://pve.proxmox.com/wiki/Perl_Style_Guide#Wrapping_Post= -If =20 As this is undefined behavior in perl: "The behaviour of a my, state, or our modified with a statement modif= ier conditional or loop construct (for example, my $x if ...) is undefin= ed." -- https://perldoc.perl.org/perlsyn#Statement-Modifiers So please use `perl -wc` and `perlcritic`, severity 5 must not warn/error=20 on anything with following rule set: https://pve.proxmox.com/wiki/Perl_Style_Guide#Basic_Linting_with_perlcrit= ic