From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B74733D1CD1 for ; Mon, 9 Mar 2026 18:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773081610; cv=none; b=qggOn+hWRQ+2LvepEB1cCYN+WFgbaGoZEzAbosVb7Aie+8xnEYIEP0eDs6cWvKwok31FeMwL9QhAUbwiK6o+DwZtQ5xwA5IKba5mByesOdi7NeFbdSMaqt7Uy8daXzOoh5EtPfNahkqjzPPQBd76ah94Yc+POd5rjX9qo9sMdss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773081610; c=relaxed/simple; bh=Rm9ju9C7zGqX4zi+4bcBnh0tAbe4lY4A0PEi0NI2lDc=; h=Content-Type:From:Mime-Version:Subject:Date:Message-Id:References: Cc:In-Reply-To:To; b=JDJsxPcVN7pmIntU5PzyCD7jFF2dKR8wNMJKuEcjIrMEPl8ZMT6GPc46pncr+6shBQk9slzvPPPcUeKbFnFfP6XjNtRSAjjjlYvhwa0CBXxaBAax9iR+v0GOkhq9XF8WhQHZp6Cc6J1c4ch+cULexp7BGNCsMOfmlaNC2i4+hw4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aGD+NU4g; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aGD+NU4g" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2ae8177446fso24862035ad.0 for ; Mon, 09 Mar 2026 11:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773081608; x=1773686408; darn=vger.kernel.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=rd9zk9JvX98f/Az0TArJAGomAXgRJmfryFiyIjHxE7Q=; b=aGD+NU4g1q7OPEaGoP+PS/ajHFSfWgdV0U8d/M56mmqxxtOzPzDnchh5p6CgtmvxAB Y8FFt7WDwpqsnOBsuqsg8Bk6a/e6eLHVxStsj6WVA7um7BRyI5nxKLTW3RtlFwIznKcT VuBmashGveqXckLdn609pJXVdYQob18N7vYRrbhiLVfCYSKKh5ipZCbYs104kb4PouTB AtAHZQ31vq0lu0s7oCdpXBOcn+c1Ygd3UzOXmcyk97wuU9hFtM/71t1+qXILer0BGdmF lHDIjFr4pTd4e0/OvFSkYUkz8ZxbyaiCz/nmwK+ggIhCBfkuJfMm+p78anyfadjm0T4i yxIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773081608; x=1773686408; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rd9zk9JvX98f/Az0TArJAGomAXgRJmfryFiyIjHxE7Q=; b=NgLcX8l8eyRmuUZq2WcghEP15VD76IkHVYN7SsoNorIsqMPj1YKqomYwKguRgUiZXS AEpvilrpwNAAOC2zmwA4QPUgB4tHblnyci3C3VvghH7HBvv/5VSyRtzQGrB1J1K3Qz06 5v7maNRV0mXsoNx2i7hxfVXC/TihiNa20j+gasmo7XCUHpKUCrRb6X/M8VE3FY2kHR2p +DZYezTyrNu/tJxQ6leppPXBys0O8tRbvZh9msKNRfNy7ywYRJkfKnKtClU0G4GelwJ7 kH6Bj58Eoy3al0g0gqDk2BsXEjgshZTcg/Wdqq/alFqRRBmoBvbLeoGoqVRj3vYJITe1 Xlxg== X-Forwarded-Encrypted: i=1; AJvYcCWZX2xDEQGWzpHX2OOKFGwtX/voIoaLN4fTtIWg0aq33ukuy1WgcjEqx/jC91vG3o/SqsmctGRdj/v7HzA=@vger.kernel.org X-Gm-Message-State: AOJu0YwDTXeQFcCMh0pDwD5QAOJiN813bPySdjUw48BA1OsfHg6ZQkTP Ve2b4guJ8MRqx4KXxDeOSxi+ZFD62cZLi/gKHHTRixDSKfnrYZu1Smwrcv0Xfs/z75N3TRvT X-Gm-Gg: ATEYQzzj1aqwn3/MtJSYBTeocbXRW92DutEfAUNE4PxLAK1MJEORzFLcoPdUHKCDPxH okPRqnAL9pZHBQLt8WpnnnUjxMb44gZGsHZz6Wcc0r2XHmX/XgiWFYR5oPXIRnO1nys10H2EDmW q0AHY2ejbgKZN/4RpSXrrE/GbmA24f50Nu3Gjvjl8gwgVQOoCMVdQND4o2QMrzLXxYP1o/HiP3Z V7HwY/LPJ7Ozq3fQIQ10qpfmDvIbUxFVxIiD+n1GN7JpTUSUipMKcOIfw3CsGeoftOfR0YnWSXZ WWfFSLh5IP0IhQHgGz1HYafQKsRC7dnYUx77BAKh3DkWrMGWrQrQFIzlRCqB2A/+iOoDfiFhvCB KNDmNihaoX2iMeQA3FxUzgD0aJiMmrrscKPNfZdVZ6VARBZQRHPlrk0BKbN6zzXbZixyvJRQwEE 5ENsqmW1njFLR2yeyVnQAEEbjay+nKBzDUv5Hsonunu8uRUju9cnRpTqHTDXPvx+jPGdA1hS4Ug w== X-Received: by 2002:a17:902:ce83:b0:2ae:4e2b:f565 with SMTP id d9443c01a7336-2ae823062f1mr121666055ad.0.1773081607947; Mon, 09 Mar 2026 11:40:07 -0700 (PDT) Received: from smtpclient.apple (wf121-066.ust.hk. [175.159.121.66]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae83e57740sm117802505ad.15.2026.03.09.11.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 11:40:07 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: =?utf-8?B?5YiY5rWp6Ziz?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2] tools/docs/checktransupdate.py: fix all issues reported by pylint Date: Tue, 10 Mar 2026 01:42:02 +0800 Message-Id: <061376E6-9AA1-4658-9B49-EFD2C754B4D4@gmail.com> References: Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: To: Jonathan Corbet , Shuah Khan , Mauro Carvalho Chehab , Dongliang Mu , Si Yanteng X-Mailer: iPhone Mail (23A355) Sent from my iPhone > On 10 Mar 2026, at 00:56, Haoyang Liu wrote: >=20 > =EF=BB=BF >> On 3/9/2026 11:54 PM, Jonathan Corbet wrote: >> Haoyang LIU writes: >>=20 >>> This patch fixes all issues reported by pylint, including: >>> 1. Format issue in logging. >>> 2. Variable name style issue. >> I'm somewhat unconvinced about that second change. We haven't come up >> with a coding style for Python code in the kernel, but I think we do >> want it to look at least a bit like kernel code and not just defer all >> decisions to tools like pylint. I'm not really opposed to this change >> either, mind you, but the process of getting there worries me a bit. >=20 > Dear Jon, >=20 > My initial thought was that 'HASH' looks like a global-style constant, whi= le it's actually a local variable. However, the lowercase 'hash' has conflic= t with python built-in hash function, so I renamed it to hash_re to indicate= that it's a regular expression. >=20 >>=20 >>> Fixes: 63e96ce050e5 ("scripts: fix all issues reported by pylint") >>> Signed-off-by: Haoyang LIU >>> --- >>> V1 -> V2: fix variable name style name and keep the format consistent wi= th other logging format >>>=20 >>> tools/docs/checktransupdate.py | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>>=20 >>> diff --git a/tools/docs/checktransupdate.py b/tools/docs/checktransupdat= e.py >>> index e894652369a5..cc07cda667fc 100755 >>> --- a/tools/docs/checktransupdate.py >>> +++ b/tools/docs/checktransupdate.py >>> @@ -76,11 +76,11 @@ def get_origin_from_trans_smartly(origin_path, t_fro= m_head): >>> (2) Update the translation through commit HASH (TITLE) >>> """ >>> # catch flag for 12-bit commit hash >>> - HASH =3D r'([0-9a-f]{12})' >>> + hash_re =3D r'([0-9a-f]{12})' >>> # pattern 1: contains "update to commit HASH" >>> - pat_update_to =3D re.compile(rf'update to commit {HASH}') >>> + pat_update_to =3D re.compile(rf'update to commit {hash_re}') >>> # pattern 2: contains "Update the translation through commit HASH" >>> - pat_update_translation =3D re.compile(rf'Update the translation thr= ough commit {HASH}') >>> + pat_update_translation =3D re.compile(rf'Update the translation thr= ough commit {hash_re}') >>> origin_commit_hash =3D None >>> for line in t_from_head["message"]: >>> @@ -131,7 +131,7 @@ def check_per_file(file_path): >>> opath =3D get_origin_path(file_path) >>> if not os.path.isfile(opath): >>> - logging.error("Cannot find the origin path for {file_path}") >>> + logging.error("Cannot find the origin path for %s", file_path) >> Why was this change made? The first time around, you'd simply added the >> obviously missing "f", which seems better? > I used the "%s" style mainly to keep the logging format consistent with th= e other logging statements in this file, which follow the same pattern. To m= e, using f-string or lazy format. To me, using f-string or lazy format are the same. ( sorry for the unfinishe= d message) Haoyang >=20 > Sincerely, > Haoyang >=20 >>=20 >> Thanks, >>=20 >> jon