Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] app/argparse: expect no value for a boolean option
Date: Tue, 12 Nov 2019 21:41:45 +0100	[thread overview]
Message-ID: <03c537b9-b903-6cec-4f52-e313f3486754@tarantool.org> (raw)
In-Reply-To: <20191112174047.tirafxzpyiytkxfl@tkn_work_nb>

Hi! Thanks for the fixes!

LGTM.

>>> +                -- Don't consume a value after a 'boolean' or
>>> +                -- 'boolean+' argument.
>>> +                if lookup[command] ~= 'boolean' and
>>> +                        lookup[command] ~= 'boolean+' then
>>
>> 2. Something is wrong with the indentation.
> 
> Let's consider three variants of splitting long if conditions:
> 
>  | if long_cond1 or
>  |    long_cond2 then
>  |     <...>
>  | end
> 
>  | if long_cond1 or
>  |     long_cond2 then
>  |     <...>
>  | end
> 
>  | if long_cond1 or
>  |         long_cond2 then
>  |     <...>
>  | end
> 
> As I see the first and the second variants are used across tarantool's
> built-in Lua code. You are right, third one, which I personally prefer,
> is not used within the project.

There is no options. The first is the only standard in our code. If the
second one is used somewhere, then it is incorrect, or is a third-party
library with own code style.

> 
> Maybe it is better to always wrap such conditions into a function and
> assign to a variable.
> 
> Anyway, now it is wrapped into a function.
> 

  reply	other threads:[~2019-11-12 20:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09  0:39 Alexander Turenko
2019-11-11 22:25 ` Vladislav Shpilevoy
2019-11-12 17:40   ` Alexander Turenko
2019-11-12 20:41     ` Vladislav Shpilevoy [this message]
2019-11-12 21:03       ` Alexander Turenko
2019-11-12 21:33         ` Vladislav Shpilevoy
2019-11-13  4:33           ` Konstantin Osipov
2019-11-13  8:40             ` Alexander Turenko
2019-11-15  0:18       ` Alexander Turenko

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=03c537b9-b903-6cec-4f52-e313f3486754@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] app/argparse: expect no value for a boolean option' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox