All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Higgins <brendanhiggins@google.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: David Gow <davidgow@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v3 3/3] kunit: tool: move kunitconfig parsing into __init__, make it optional
Date: Mon, 11 Jan 2021 13:24:30 -0800	[thread overview]
Message-ID: <CAFd5g463LHZmtwu4MwKBOK8b5_0rpBpGUFZEC00qVwxEJXgpRQ@mail.gmail.com> (raw)
In-Reply-To: <20210107234803.1096592-3-dlatypov@google.com>

On Thu, Jan 7, 2021 at 3:48 PM Daniel Latypov <dlatypov@google.com> wrote:
>
> LinuxSourceTree will unceremoniously crash if the user doesn't call
> read_kunitconfig() first in a number of functions.
>
> And currently every place we create an instance, the caller also calls
> create_kunitconfig() and read_kunitconfig().
> Move these instead into __init__() so they can't be forgotten and to
> reduce copy-paste.
>
> The https://github.com/google/pytype type-checker complained that
> _config wasn't initialized. With this, kunit_tool now type checks
> under both pytype and mypy.
>
> Add an optional boolean that can be used to disable this for use cases
> in the future where we might not need/want to load the config.
>
> Signed-off-by: Daniel Latypov <dlatypov@google.com>

Very nice! This makes the code much more readable!

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>

  reply	other threads:[~2021-01-11 21:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 23:48 [PATCH v3 1/3] kunit: tool: surface and address more typing issues Daniel Latypov
2021-01-07 23:48 ` [PATCH v3 2/3] kunit: tool: fix minor typing issue with None status Daniel Latypov
2021-01-11 21:19   ` Brendan Higgins
2021-01-07 23:48 ` [PATCH v3 3/3] kunit: tool: move kunitconfig parsing into __init__, make it optional Daniel Latypov
2021-01-11 21:24   ` Brendan Higgins [this message]
2021-01-11 21:15 ` [PATCH v3 1/3] kunit: tool: surface and address more typing issues Brendan Higgins
2021-01-15  0:32 ` Brendan Higgins

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=CAFd5g463LHZmtwu4MwKBOK8b5_0rpBpGUFZEC00qVwxEJXgpRQ@mail.gmail.com \
    --to=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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.