From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Stefan Reiter <s.reiter@proxmox.com>,
Oguz Bektas <o.bektas@proxmox.com>
Subject: Re: [pve-devel] [RFC v2 storage] smartctl: use json parsing
Date: Wed, 31 Mar 2021 14:33:54 +0200 [thread overview]
Message-ID: <710bac68-6ff0-892d-111a-eed88f456f2c@proxmox.com> (raw)
In-Reply-To: <f52d5092-5b67-ad0c-b260-719829bcb9ec@proxmox.com>
did not looked at all, so just a single comment.
On 31.03.21 14:06, Stefan Reiter wrote:
>> + my $wearout = 100.0 - $json_result->{nvme_smart_health_information_log}->{percentage_used} if !$healthonly;
>
> too long even for my liking, needs a line break somewhere :)
Yeah, there's more to it...
1. I explicitly wrote a "Wrapping Post-If" section for the last time somebody
(*wink*) used it: https://pve.proxmox.com/wiki/Perl_Style_Guide#Wrapping_Post-If
2. `my $foo = "bar" if !$baz` is a bug! From the s
"Also remember that you must NOT use post if when declaring the variable for
the first time with my!"
-- end of https://pve.proxmox.com/wiki/Perl_Style_Guide#Wrapping_Post-If
As this is undefined behavior in perl:
"The behaviour of a my, state, or our modified with a statement modifier
conditional or loop construct (for example, my $x if ...) is undefined."
-- https://perldoc.perl.org/perlsyn#Statement-Modifiers
So please use `perl -wc` and `perlcritic`, severity 5 must not warn/error
on
anything with following rule set:
https://pve.proxmox.com/wiki/Perl_Style_Guide#Basic_Linting_with_perlcritic
prev parent reply other threads:[~2021-03-31 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 12:23 Oguz Bektas
2021-03-31 12:06 ` Stefan Reiter
2021-03-31 12:17 ` Oguz Bektas
2021-03-31 12:33 ` Thomas Lamprecht [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=710bac68-6ff0-892d-111a-eed88f456f2c@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=o.bektas@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=s.reiter@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.