DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Vizzarro <luca.vizzarro@arm.com>
To: dev@dpdk.org, Patrick Robb <probb@iol.unh.edu>
Cc: Luca Vizzarro <luca.vizzarro@arm.com>,
	Paul Szczepanek <paul.szczepanek@arm.com>
Subject: [PATCH 2/6] dts: enable Ruff preview pydoclint rules
Date: Tue, 10 Dec 2024 10:32:49 +0000	[thread overview]
Message-ID: <20241210103253.3931003-3-luca.vizzarro@arm.com> (raw)
In-Reply-To: <20241210103253.3931003-1-luca.vizzarro@arm.com>

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 <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 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


  parent reply	other threads:[~2024-12-10 10:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 10:32 [PATCH 0/6] dts: add Ruff and docstring linting Luca Vizzarro
2024-12-10 10:32 ` [PATCH 1/6] dts: add Ruff as linter and formatter Luca Vizzarro
2024-12-10 10:32 ` Luca Vizzarro [this message]
2024-12-10 10:32 ` [PATCH 3/6] dts: fix docstring linter errors Luca Vizzarro
2024-12-10 10:32 ` [PATCH 4/6] dts: apply Ruff formatting Luca Vizzarro
2024-12-10 10:32 ` [PATCH 5/6] dts: update dts-check-format to use Ruff Luca Vizzarro
2024-12-10 10:32 ` [PATCH 6/6] dts: remove old linters and formatters Luca Vizzarro
2024-12-12 14:00 ` [PATCH v2 0/7] dts: add Ruff and docstring linting Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 1/7] dts: add Ruff as linter and formatter Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 2/7] dts: enable Ruff preview pydoclint rules Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 3/7] dts: resolve docstring linter errors Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 4/7] dts: apply Ruff formatting Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 5/7] dts: update dts-check-format to use Ruff Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 6/7] dts: remove old linters and formatters Luca Vizzarro
2024-12-12 14:00   ` [PATCH v2 7/7] dts: update linters in doc page Luca Vizzarro
2024-12-17 10:15     ` Xu, HailinX
2024-12-20 23:14   ` [PATCH v2 0/7] dts: add Ruff and docstring linting Patrick Robb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241210103253.3931003-3-luca.vizzarro@arm.com \
    --to=luca.vizzarro@arm.com \
    --cc=dev@dpdk.org \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).