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 1FF7445E68; Tue, 10 Dec 2024 11:34:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E226B40612; Tue, 10 Dec 2024 11:34:21 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id B65A6402AE for ; Tue, 10 Dec 2024 11:34:18 +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 2012F1570; Tue, 10 Dec 2024 02:34:46 -0800 (PST) Received: from localhost.localdomain (JR4XG4HTQC.cambridge.arm.com [10.1.31.80]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 690FB3F58B; Tue, 10 Dec 2024 02:34:17 -0800 (PST) From: Luca Vizzarro To: dev@dpdk.org, Patrick Robb Cc: Luca Vizzarro , Paul Szczepanek Subject: [PATCH 2/6] dts: enable Ruff preview pydoclint rules Date: Tue, 10 Dec 2024 10:32:49 +0000 Message-ID: <20241210103253.3931003-3-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210103253.3931003-1-luca.vizzarro@arm.com> References: <20241210103253.3931003-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