public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [RFC] Remove [Description] subtitle from docparse
Date: Fri, 31 Jan 2025 12:32:45 +0100	[thread overview]
Message-ID: <Z5y03QTwjlgsuJ88@yuki.lan> (raw)
In-Reply-To: <20250131091535.GB1090737@pevik>

Hi!
> Can we remove [Description] part from docparse documentation in tests?
> This is transformed into "Description" subtitle in resulted html/pdf.
> 
> 1) It's not really needed (it's obvious that it's a description of the test)
> 2) Sometimes it's missing (inconsistency).

That part can be fixed with something as:

diff --git a/metadata/metaparse.c b/metadata/metaparse.c
index 2b96149dc..422604a2c 100644
--- a/metadata/metaparse.c
+++ b/metadata/metaparse.c
@@ -852,6 +852,14 @@ static struct data_node *parse_file(const char *fname)
 
        if (data_node_array_len(doc)) {
                data_node_hash_add(res, "doc", doc);
+
+               char *str = doc->array.array[0]->string.val;
+
+               if (!strstr("[Description]", str)) {
+                       fprintf(stderr, "%s: Missing [Description] in doc comment!\n", fname);
+                       exit(1);
+               }
+
                found = 1;
        } else {
                data_node_free(doc);

> I would keep other subtitles (e.g. [Algorithm]), just remove the first one.

I find it a bit inconsistent if we do it this way, but I guess either
way is fine.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2025-01-31 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31  9:15 [LTP] [RFC] Remove [Description] subtitle from docparse Petr Vorel
2025-01-31  9:38 ` Andrea Cervesato via ltp
2025-01-31 10:34   ` Petr Vorel
2025-01-31 10:48     ` Andrea Cervesato via ltp
2025-01-31 11:58       ` Petr Vorel
2025-01-31 11:32 ` Cyril Hrubis [this message]
2025-01-31 11:50   ` Petr Vorel

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=Z5y03QTwjlgsuJ88@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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