From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ecf61b3a for ; Wed, 9 Oct 2019 04:03:21 +0000 (UTC) Received: (qmail 29168 invoked by alias); 9 Oct 2019 04:03:12 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24327 Received: (qmail 10069 invoked by uid 1010); 9 Oct 2019 04:03:12 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua1-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25594. spamassassin: 3.4.2. Clear:RC:0(209.85.222.46):SA:0(-2.0/5.0):. Processed in 2.591552 secs); 09 Oct 2019 04:03:12 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.222.46 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=TQl4hVWIP8csYS9o0mTzkBaf96OqJvUm1GwXQz0ilm4=; b=qE1kftcShQUJlkjrE/ZUckwlrTM5dKl4mgHX8JuPCX4b0PJgYcewsTzH5LZ/o0HpnI v0rHNaojcJaGOk3fAIXGpAIYhEFFaH2XHxjQ3Q1RLr+32UJa5HaF1MO4FsfLZzlE2YUP lYZtIsC181d9bZIjJdl2tovEczU1POhO/L3LoBPToyyLkzTCXt6A1w3GeJG6gx7JXJ2r ODJuk/aLx7cZCzvp9Wt2rXPbk4TJAeM9YHFgSCOix/14DtdjLwgD6CFRV86fj+vIaXMa 354bxf8iIraBCrLDKvlbztA/MY7Kje1ZpWSQ5uN3anMPEDaivZZwBs5QWEcoHJIs4HYS Ci2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=TQl4hVWIP8csYS9o0mTzkBaf96OqJvUm1GwXQz0ilm4=; b=fnLhsB5FCgMfpqa/aS6w0ODpF0dYITSPqcaV7173GivxlU/KfatSXMra9xg7zJcXok 96eF/NYueZzQ9405DhJrcg/8Ap0uQ5XeCt+j3RLZpEFHYS44NQaAkij6CKgXWWQGguPP byalkSMmSIqTASB1TGezc0dZolmY/jd81gwzZJwzq0EM/aAQ3QOaHsgEYfv8wGHyI52M XfLzuyQcWXRVZf0GYxKMde6hccwJIKgip00ARakpW8rTh51AD8s5TwLWLoZHaD/CQuQB fOTrH/9ptTqnTYZEZPVsqtswiGW13TSK0AaJ02NXt+VjA2aSZ1eiQSnCC2RHkHWvj5FI TmIQ== X-Gm-Message-State: APjAAAVD6435YQWRhpKH5fRZXGukgRHyA6E7UjTTFeZllHjpPhSGqC8v mINn2s+xBmIlqKP/ayMBVOHfzzA4BvS2IyyomOC3OYMA X-Google-Smtp-Source: APXvYqz+qSi18dNKcMKpZK34IBmAvZBA1fja1XBtCfIaHdxYypeAXo/SZe6aT6MSa3wAJsV4nCGUNG8zSzP1kpMeBq0= X-Received: by 2002:ab0:2456:: with SMTP id g22mr816995uan.82.1570593755345; Tue, 08 Oct 2019 21:02:35 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Wed, 9 Oct 2019 06:02:26 +0200 Message-ID: Subject: Feature request: a new warning option To: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, how about detecting situations in the code like the following: fun() { some code possibly returning false } (( condition )) && fun || print "Some 'else'-instruction" The warning would be triggered when: - a an || would occur after an instruction preceded by &&, - the instruction wouldn't be an always-true instruction, i.e. not ((1)), local var=3D"value", etc. =E2=80=93 this would also include prints e= tc., as the stdout can be closed and such instruction CAN fail =E2=80=93 the usefulness of the option is visible here, it would make the users conscious of such fact. Is this doable? To detect a preceding && and a following ||, and check if the instruction is a function or a print? The name of such option could be: warn_symmetric_cond, it would describe the fact of symmetric way of condition processing. To solve the warning, the users could e.g. convert the fun into { fun; ((1)) } or use an if. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org