From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: STYLE message about full stop at the end of .Nd; inspired by
Date: Thu, 1 Jun 2017 10:26:10 -0500 (EST) [thread overview]
Message-ID: <15597149310647523388.enqueue@fantadrom.bsd.lv> (raw)
Log Message:
-----------
STYLE message about full stop at the end of .Nd; inspired by mdoclint(1)
Modified Files:
--------------
mdocml:
mandoc.1
mandoc.h
mdoc_validate.c
read.c
Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v
retrieving revision 1.329
retrieving revision 1.330
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.329 -r1.330
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -1076,6 +1076,7 @@ static void
post_nd(POST_ARGS)
{
struct roff_node *n;
+ size_t sz;
n = mdoc->last;
@@ -1089,6 +1090,11 @@ post_nd(POST_ARGS)
if (n->child == NULL)
mandoc_msg(MANDOCERR_ND_EMPTY, mdoc->parse,
n->line, n->pos, "Nd");
+ else if (n->last->type == ROFFT_TEXT &&
+ (sz = strlen(n->last->string)) != 0 &&
+ n->last->string[sz - 1] == '.')
+ mandoc_msg(MANDOCERR_ND_DOT, mdoc->parse,
+ n->last->line, n->last->pos + sz - 1, NULL);
post_hyph(mdoc);
}
Index: mandoc.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc.h,v
retrieving revision 1.218
retrieving revision 1.219
diff -Lmandoc.h -Lmandoc.h -u -p -r1.218 -r1.219
--- mandoc.h
+++ mandoc.h
@@ -48,6 +48,7 @@ enum mandocerr {
MANDOCERR_MACRO_USELESS, /* useless macro: macro */
MANDOCERR_BX, /* consider using OS macro: macro */
+ MANDOCERR_ND_DOT, /* description line ends with a full stop */
MANDOCERR_WARNING, /* ===== start of warnings ===== */
Index: read.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/read.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -Lread.c -Lread.c -u -p -r1.167 -r1.168
--- read.c
+++ read.c
@@ -90,6 +90,7 @@ static const char * const mandocerrs[MAN
"useless macro",
"consider using OS macro",
+ "description line ends with a full stop",
"generic warning",
Index: mandoc.1
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc.1,v
retrieving revision 1.191
retrieving revision 1.192
diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.191 -r1.192
--- mandoc.1
+++ mandoc.1
@@ -763,6 +763,11 @@ macro that could be represented using
.Ic \&Fx ,
or
.Ic \&Dx .
+.It Sy "description line ends with a full stop"
+.Pq mdoc
+Do not use punctuation at the end of an
+.Ic \&Nd
+block.
.El
.Ss Warnings related to the document prologue
.Bl -ohang
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2017-06-01 15:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=15597149310647523388.enqueue@fantadrom.bsd.lv \
--to=schwarze@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/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).