From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24E1A45E85; Thu, 12 Dec 2024 15:02:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17D194060B; Thu, 12 Dec 2024 15:02:26 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 195D3402E3 for ; Thu, 12 Dec 2024 15:02:24 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 424D6153B; Thu, 12 Dec 2024 06:02:51 -0800 (PST) Received: from localhost.localdomain (JR4XG4HTQC.cambridge.arm.com [10.1.33.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8B6023F58B; Thu, 12 Dec 2024 06:02:22 -0800 (PST) From: Luca Vizzarro To: dev@dpdk.org Cc: Patrick Robb , Luca Vizzarro , Paul Szczepanek Subject: [PATCH v2 2/7] dts: enable Ruff preview pydoclint rules Date: Thu, 12 Dec 2024 14:00:08 +0000 Message-ID: <20241212140013.17548-3-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241212140013.17548-1-luca.vizzarro@arm.com> References: <20241210103253.3931003-1-luca.vizzarro@arm.com> <20241212140013.17548-1-luca.vizzarro@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org DTS requires a linter for docstrings but the current selection is limited. The most promising docstring linter is pydoclint. On the other hand, Ruff is currently in the process of implementing pydoclint rules. This would spare the project from supporting yet another linter, without any loss of benefit. This commit enables a selection of pydoclint rules in Ruff, which while still in preview they are already capable of aiding the process. DOC201 was omitted because it currently does not support one-line docstrings, trying to enforce full ones even when not needed. DOC502 was omitted because it complains for exceptions that were reported but not present in the body of the function. While treating documented exceptions when they appear to not be raised as an error is a sound argument, it currently doesn't work well with inherited class methods, which parent does raise exceptions. Bugzilla ID: 1455 Signed-off-by: Luca Vizzarro Reviewed-by: Paul Szczepanek --- dts/pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dts/pyproject.toml b/dts/pyproject.toml index 3436d82116..2658a3d22c 100644 --- a/dts/pyproject.toml +++ b/dts/pyproject.toml @@ -65,7 +65,11 @@ select = [ "D", # pydocstyle "C90", # mccabe "I", # isort + # pydoclint + "DOC202", "DOC402", "DOC403", "DOC501" ] +preview = true # enable to get early access to pydoclint rules +explicit-preview-rules = true # enable ONLY the explicitly selected preview rules [tool.ruff.lint.pydocstyle] convention = "google" -- 2.43.0