public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Fix public/private kernel-doc issues
@ 2026-03-09 16:47 Mauro Carvalho Chehab
  2026-03-09 16:47 ` [PATCH 1/8] docs: python: add helpers to run unit tests Mauro Carvalho Chehab
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2026-03-09 16:47 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab
  Cc: Mauro Carvalho Chehab, linux-doc, linux-kernel,
	Aleksandr Loktionov, Randy Dunlap, Shuah Khan

Hi Jon,

This patch set fixes public/private handling inside comments.

The current logic has currently an issue: it breaks nested
structs if private: is not followed by public:.

It also solves a currently undefined behavior: now,
public/private are applied only to the current and
inner statements. So, if one does:

  struct {
	struct {
		/* private: */
		int a;
		struct {
			int b;
		};
	};
	int c;
  };

The output will be:

  struct {
	int c;
  };

Besides making sensing itself, the new behavior solves
an issue when struct_group() macros are used, as the
private from one struct_group won't propagate to other
ones nor to the struct encapsulating one or more
struct_group().

This series start with 2 unittests to detect the problem.
If you apply those two patches and run the unit test,
you'll be able to see the issue.

After applying the changes, it renames the unit test,
making it test directly the code there, instead of the
current wrapper at kdoc_re, and add more tests meant
to check the tokenizer itself.

-

As commented previously, I'm now working on a patchset
using the tokenizer for NestedMatch. I have already
some code here, but not properly tested yet.

Anyway, the idea is to keep submitting it in small
chunks, to make it easier to review.

Mauro Carvalho Chehab (8):
  docs: python: add helpers to run unit tests
  unittests: add a testbench to check public/private kdoc comments
  docs: kdoc: don't add broken comments inside prototypes
  docs: kdoc: properly handle empty enum arguments
  docs: kdoc_re: add a C tokenizer
  docs: kdoc: use tokenizer to handle comments on structs
  unittests: test_private: modify it to use CTokenizer directly
  unittests: test_tokenizer: check if the tokenizer works

 Documentation/tools/python.rst       |   2 +
 Documentation/tools/unittest.rst     |  24 ++
 tools/lib/python/kdoc/kdoc_parser.py |  25 +-
 tools/lib/python/kdoc/kdoc_re.py     | 234 ++++++++++++++
 tools/lib/python/unittest_helper.py  | 353 ++++++++++++++++++++
 tools/unittests/test_tokenizer.py    | 462 +++++++++++++++++++++++++++
 6 files changed, 1088 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/tools/unittest.rst
 create mode 100755 tools/lib/python/unittest_helper.py
 create mode 100755 tools/unittests/test_tokenizer.py

-- 
2.52.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-09 16:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 16:47 [PATCH 0/8] Fix public/private kernel-doc issues Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 1/8] docs: python: add helpers to run unit tests Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 2/8] unittests: add a testbench to check public/private kdoc comments Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 3/8] docs: kdoc: don't add broken comments inside prototypes Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 4/8] docs: kdoc: properly handle empty enum arguments Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 5/8] docs: kdoc_re: add a C tokenizer Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 6/8] docs: kdoc: use tokenizer to handle comments on structs Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 7/8] unittests: test_private: modify it to use CTokenizer directly Mauro Carvalho Chehab
2026-03-09 16:47 ` [PATCH 8/8] unittests: test_tokenizer: check if the tokenizer works Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox