From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00AD4606A69D for ; Tue, 1 Dec 2026 14:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Hwr3aY1v Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYOU8-0004yH-TN; Tue, 01 Dec 2026 09:05:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYOU5-0004xs-1y for qemu-devel@nongnu.org; Tue, 01 Dec 2026 09:05:29 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xYOU3-0007lX-DE for qemu-devel@nongnu.org; Tue, 01 Dec 2026 09:05:28 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4a3517554f7so106539815e9.2 for ; Tue, 01 Dec 2026 06:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796133925; x=1796738725; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to:content-type; bh=Ik54FBl+T7o4/XXLX5RfUzx26U31pFBat7mGB8vEdRE=; b=Hwr3aY1vB2yc7GNtrrg/ptSVXqysV7+hlMdfZ7vNYOKdUpHp0FsXR4fH4FKQIvgDrG 3slEDVzYUYitRfzp6U9+6k5e6ZSwDxFN3qYl2QDk32DQkh6RKE8Vd/xgRh7tlqXZKicE +GgAwaDfBnbTzyrvEQiPtcFjFwdTXr8OODfEEjK0LzBh9eBgjn6bdAr7x4HP2BJJTeuq 7pET861T1lrC9/U563b9TP5f9ePdezbxKP4Lt83rehGDkxEmzSJklNBAwksO/bPvN2OH M7+ZJpw1WQ9iVWn3T4iQaVhkrhiArVo7+RoKzOlU1IksNGre2DMMlyJ2o8n82PKzJhrF qWQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796133925; x=1796738725; h=content-transfer-encoding:content-type:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Ik54FBl+T7o4/XXLX5RfUzx26U31pFBat7mGB8vEdRE=; b=lVcZTNxYWV3A7N2gQ7mxrEggdglMEt+gyfJTRn7Y4CL8Nl0bwnCtTGyS+jJOJpp2Qw TX1SCVzuQrf0kmvQ5q2Rix4mHbfgCkrqp6BwGu+FPBlqiXDcl06X0YJjRD9qEWOL2TzK 4J7y+JFzy5Bygs94LBlz3B3kCHAQaSb3/0mVSmAmmQvEKQ45PscIxb7VSwMQSOsrL/dG O1+oWS4ENiNdGc/PGm+69O/KeH9DNYj9oEcKupoTxeeh9Q/5Mj3zsWub7yNsUOAvDWqZ 1QdBrT9xOg8h7LFGshl3y16hjIfMoWXm50worDCmjO6zfr7zckjXAjbnVL3egQ4rMEys /itg== X-Gm-Message-State: APuU4Z/bB0FcngaINyL9qTjLUPnhLqyh+vaMhJQ6aZbk0JYrxGZ8b8Lx /eIXGduHj1clV9zql1mtvwyJdR+HOSKPNnpSE/luWbaALK4ddokqdoP5OCuR4dUsWt7JNhoK0L2 KPXGK X-Gm-Gg: AZFdTZdXbsi2EVADw5Derl7hfWeIiL5SgQTslnAHkjRR5T7AsAbviiXIwT3VUTQ6T0f 1qnE4wY0W7fA1QIKSSNIFb77Bs0swWWBtLWIFPnHnzh2jngKBJmIR+LW+3kdqScirICIwWiLGAC GAaNc9XJE7yZuNxOSlt7cwYmIKqM5rhYEHi5qlYVJQ+IZJf/YhAsYpQaQcAElLm3SGWqAmzJCx8 A521I5yzL2+pNM21D6UjMzvupATIX/RUopn0qE3rzaX7FQKZpNXLOVy2FPohcY9/QICvyKb76gA laSfKck/XRLi/h7Okg7hC5hYYCjJdQjms95h9U+r5Qdhtrf2EoJn2J6ZosSZriJX7GOFyWO4beK Tu6AI+2qRfT/UQR3Vd+i0Y84KH/oW5R+PhEJ9JiJgBX5mq0NPHaAdMSGEsLkFxfpTTghcE22iWp 1zhJq1Y9SmkIUqQuZfRsK6uR6qBQ7RrMoMhuZw9ZVG4M6YS0YnMDhL2ORf2AsO0Cf4T+VTX1zpV Y7WSKb3+0mUKJ1CapX0u6jVcy4QYvRg73NX5Gbh8V/aU3oQMVPpDmukJ6qbIca7Zy2FARxriH+f qJw/IAwHxghxZODFvW8TvQOCMclDYV1Vq8lISaYk9HSxeUWiqA== X-Received: by 2002:a05:600c:5306:b0:4bb:6ac0:6dc1 with SMTP id 5b1f17b1804b1-4bb887c994cmr698946845e9.2.1796133924385; Tue, 01 Dec 2026 06:05:24 -0800 (PST) Received: from draig.lan ([185.124.0.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb85399d52sm951267125e9.6.2026.12.01.06.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 06:05:23 -0800 (PST) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1484D5F7EC; Tue, 01 Dec 2026 14:05:21 +0000 (GMT) From: =?utf-8?Q?Alex_Benn=C3=A9e?= To: Daniel P. =?utf-8?Q?Berrang=C3=A9?= Cc: qemu-devel@nongnu.org, John Snow , Pierrick Bouvier , Cleber Rosa Subject: Re: [PATCH 01/22] scripts/get_maintainer.py: minimal argument parsing In-Reply-To: ("Daniel P. =?utf-8?Q?Berrang?= =?utf-8?Q?=C3=A9=22's?= message of "Mon, 23 Nov 2026 10:00:52 +0000") References: <20261120200511.822573-1-alex.bennee@linaro.org> <20261120200511.822573-2-alex.bennee@linaro.org> User-Agent: mu4e 1.14.5-pre2; emacs 30.1 Date: Tue, 01 Dec 2026 14:05:20 +0000 Message-ID: <87v75d2j1b.fsf@draig.linaro.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Daniel P. Berrang=C3=A9 writes: > On Fri, Nov 20, 2026 at 08:04:49PM +0000, Alex Benn=C3=A9e wrote: >> Signed-off-by: Alex Benn=C3=A9e >>=20 >> --- >> v3 >> - treat dir as valid as well (as git ls-files lists it) >> - move arg parse into own function (parse_args) >> - set files nargs as + for more flexibility >> - use python3 >> --- >> scripts/get_maintainer.py | 49 +++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 49 insertions(+) >> create mode 100755 scripts/get_maintainer.py >>=20 >> diff --git a/scripts/get_maintainer.py b/scripts/get_maintainer.py >> new file mode 100755 >> index 00000000000..47673a5013f >> --- /dev/null >> +++ b/scripts/get_maintainer.py >> @@ -0,0 +1,49 @@ >> +#!/usr/bin/env python3 >> +# >> +# get_maintainer.py: Print selected MAINTAINERS information >> +# >> +# usage: scripts/get_maintainer.py [OPTIONS] >> +# scripts/get_maintainer.py [OPTIONS] -f >> +# >> +# (c) 2025, Alex Benn=C3=A9e >> +# based on get_maintainers.pl >> +# >> +# SPDX-License-Identifier: GPL-2.0-or-later >> + >> +from argparse import ArgumentParser, ArgumentTypeError >> +from os import path > > This shouldn't be needed if you're intending to use pathlib. > >> +from pathlib import Path >> + >> + >> +def valid_file_path(arg): >> + """ >> + Checks if arg exists and is a regular file or raises ArgumentTypeEr= ror. >> + """ > > IIUC, if you add add "type=3DPath" to the group.add_argument() call in > parse_args, then you can assume 'arg' is a pathlib.Path and so.... ahh but then I can't validate it with the function ;-) I was kinda hoping that type=3DPath would automatically fail at arg parsing so I didn't need to be defensive later on in the code. However I couldn't figure it out hence the valid_file_path hack. --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro