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 617F96CE5F for ; Wed, 3 Feb 2021 10:55:31 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4E49318BB2 for ; Wed, 3 Feb 2021 10:55:01 +0100 (CET) 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 81F3418BA8 for ; Wed, 3 Feb 2021 10:55:00 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 4262E46187 for ; Wed, 3 Feb 2021 10:55:00 +0100 (CET) To: pve-devel@lists.proxmox.com References: <20210201142131.30024-1-a.lauterer@proxmox.com> <20210201142131.30024-3-a.lauterer@proxmox.com> <391d702f-766b-0c5d-c9e1-b7d3fab6dca4@proxmox.com> <3dfa74fd-ccd4-b1b4-7b16-94b1e3d4a095@proxmox.com> From: Aaron Lauterer Message-ID: Date: Wed, 3 Feb 2021 10:54:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <3dfa74fd-ccd4-b1b4-7b16-94b1e3d4a095@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.069 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.178 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. [eslint.org, proxmox.com] Subject: Re: [pve-devel] [PATCH manager 2/7] ui: qemu/HardwareView: eslint: enforce "max-len" rule 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, 03 Feb 2021 09:55:31 -0000 On 2/3/21 10:50 AM, Aaron Lauterer wrote: > > > On 2/3/21 8:40 AM, Thomas Lamprecht wrote: >> On 01.02.21 15:21, Aaron Lauterer wrote: >>> Signed-off-by: Aaron Lauterer >>> --- >>>   www/manager6/qemu/HardwareView.js | 4 +++- >>>   1 file changed, 3 insertions(+), 1 deletion(-) >>> >>> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js >>> index 51c77246..fa72d9d3 100644 >>> --- a/www/manager6/qemu/HardwareView.js >>> +++ b/www/manager6/qemu/HardwareView.js >>> @@ -593,7 +593,9 @@ Ext.define('PVE.qemu.HardwareView', { >>>           var isEfi = key === 'efidisk0'; >>> -        remove_btn.setDisabled(rec.data.delete || rowdef.never_delete === true || (isUnusedDisk && !diskCap)); >>> +        remove_btn.setDisabled(rec.data.delete || >>> +                   rowdef.never_delete === true || >>> +                   (isUnusedDisk && !diskCap)); >> >> If a method call is split over multiple lines the first line should only >> be the method itself. >> >> As we have an expression here, not really multiple parameters, either of the >> following two would be fine: >> >> remove_btn.setDisabled( >>      rec.data.delete || rowdef.never_delete === true || (isUnusedDisk && !diskCap) >> ); >> >> or: >> >> remove_btn.setDisabled( >>      rec.data.delete || >>      rowdef.never_delete === true || >>      (isUnusedDisk && !diskCap) >> ); >> >> > > Maybe we want to add a eslint rule to catch these? I am usually getting this wrong and having a linter rule will help to catch it early on. AFAICT the 'function-paren-newline' set to 'multiline' or 'multiline-arguments' [0] should work. > > > [0] https://eslint.org/docs/rules/function-paren-newline Of course, this won't work in this use case as they are not parameters. I'll keep looking if there is a rule for this situation that could help. > >>>           remove_btn.setText(isUsedDisk && !isCloudInit ? remove_btn.altText : remove_btn.defaultText); >>>           remove_btn.RESTMethod = isUnusedDisk ? 'POST':'PUT'; >>> >> > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > >