Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2578408pxb; Mon, 11 Jan 2021 13:29:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXfOsoqHxRb4Tm4EYD7o0GBX8lxA4ghZgyupSUamlyeQbsdDDowiy9mAA5wsAh83qtMvgB X-Received: by 2002:a05:6402:c0b:: with SMTP id co11mr926110edb.180.1610400569463; Mon, 11 Jan 2021 13:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610400569; cv=none; d=google.com; s=arc-20160816; b=nzJ38IXriNGvoKzhxrXp+7p5BTmTgOakPeLwlEutKsJ8ucNNSGF4BmIiirNuypORke 6H3zRnfc4vFbDnVLiwFcDcynCeNIRHCdYLfObRdY/RmemcR30buiLSPJFwq0sjm2hiXz MJA8N1OH2s2nI6nXGCT+II8txtseISP899zhKNZtzR3Wlo84WUDSDBwJmCzmib2IbcQq f8TT9vW6senu6ryN5ZVOEibS8LVfolfLZMf0XTPXoKumn+fOGVi8CQsjjweLAyHMvEeX UvogYzAiQIwcsOAnrMUyEwmdyU7bw5SaGEKYN5UjjAC/oHlkp8c+undjgvxKQYCiUylW Bp/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hRm+BijPKOU/rUYvlIyBpR5Ozh0y7fiadDPD2OBagxc=; b=O9cbwx6EYvA+AI/ONliALBYeg04ik0DlBkcJ8J2hzwT6Iso9gCoRB1eGBTQ3t1gK6e aq8kqCY+LEniFh+oh/HHSoys9l+0aVWDLtjLTnYVt2VGafoDGTNTDL6pWuEZ82Ar49CZ 5aigZsM82k63JGouekpiN1H0F/+WEkZ7NPEzFhEexK20e63CtAya9TsVBJnFh1FvM2+H AZZUcIeEC9/6MkHiwLJu8DyWvJYB+7iT0Lws6azqPMvDJ5xSfq0MtwsSRTerVpypetjh 2hFroFz5ZuEGfJ+/to1c2tziHF6V4YnsrWIA7RWP3QLlX5k3i9pdFin0/8Zn4uzQabL5 oIdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AKpOd3qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si367304edv.178.2021.01.11.13.29.04; Mon, 11 Jan 2021 13:29:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AKpOd3qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730808AbhAKVZY (ORCPT + 99 others); Mon, 11 Jan 2021 16:25:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730263AbhAKVZW (ORCPT ); Mon, 11 Jan 2021 16:25:22 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A5BBC0617A2 for ; Mon, 11 Jan 2021 13:24:42 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id lj6so318723pjb.0 for ; Mon, 11 Jan 2021 13:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hRm+BijPKOU/rUYvlIyBpR5Ozh0y7fiadDPD2OBagxc=; b=AKpOd3qvdthJIPjjkuNyUdVd3bOcbZNJmvkB6r/Kz5XPDOJEsNxaElJe5XqEYMhJlG PeZ57yRAgxnSEgai3ljCQHgTgKO4RAn2Yl3sDVUNHksKXT7aRB3OHlEmI5OlIWlYiRrC 9DVKmDPDQzZenC17YfJ0LsFR2/+BcnS8TEaN1lhUF09saumuieO7eFUVJKIh9tLdPTOP e4V4q6UNmRSC7bZelnTzMPgODv/2HIvVCPWI/vNU3E81SW6jFXdqCb7NcGmH+rSMs0V4 aDDIMA4uu3NX5GoEmb7UAF5nDTtiZZzXVXdW4UJuJVFBP8WUUxrDS2m6uja+h8iqGvRd jzhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hRm+BijPKOU/rUYvlIyBpR5Ozh0y7fiadDPD2OBagxc=; b=qJ27TaamcYq7qS/uTLE08v8a4blUQgLtvbcHiA7hMny9a6CB2/+X/xuyNH3x2JN+hP oRZhk6kCJ/eO17Oc+oJJu9z6Zm4f7fCvC0EhptahQtmsLC1lO+S4Zi2Ewfnd7Gw98Dau 338NrOXEbTAY4bupbh42/71Jd0cMBItkBTVjFjQsrfCj+p3WwGAq1Ucn0hgKC9Nbqs/8 4lle4D8GFC9wl4AeoEKYCWy/Gyb879kZ+gupC/yZzmjA5Say9EBm1dlzKKxMEYedl1tK m13EzU5FmT/sALkH1DWrtqZGyyzN4eO1dv9RkAkn21ci+UrVPiGyOGEtGbScJNWojVII CbLg== X-Gm-Message-State: AOAM531TRfS/FYifr6N035gE0mRzQ9/YnFHrzAvUpZgH/gsnIc0xpn1a QWsN/srqcwy1QP7vAd+/PE+YqjVrTmJ2TnQ3q6tUng== X-Received: by 2002:a17:90a:de03:: with SMTP id m3mr901144pjv.20.1610400281705; Mon, 11 Jan 2021 13:24:41 -0800 (PST) MIME-Version: 1.0 References: <20210107234803.1096592-1-dlatypov@google.com> <20210107234803.1096592-3-dlatypov@google.com> In-Reply-To: <20210107234803.1096592-3-dlatypov@google.com> From: Brendan Higgins Date: Mon, 11 Jan 2021 13:24:30 -0800 Message-ID: Subject: Re: [PATCH v3 3/3] kunit: tool: move kunitconfig parsing into __init__, make it optional To: Daniel Latypov Cc: David Gow , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 7, 2021 at 3:48 PM Daniel Latypov 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 Very nice! This makes the code much more readable! Reviewed-by: Brendan Higgins