* mdocml: STYLE message about full stop at the end of .Nd; inspired by
@ 2017-06-01 15:26 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-01 15:26 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-01 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01 15:26 mdocml: STYLE message about full stop at the end of .Nd; inspired by schwarze
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).