Article View: muc.lists.freebsd.hackers
Article #103Re: mandoc-lint-regression.sh: catch new mandoc lint warnings before you commit
From: Enji Cooper (yaneurabeya)
Date: Thu, 19 Nov 2026 18:24
Date: Thu, 19 Nov 2026 18:24
88 lines
9333 bytes
9333 bytes
--Apple-Mail=_FE2B07B2-F428-458F-B875-3265188B1AD8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
> On Nov 19, 2026, at 3:18=E2=80=AFAM, Wolfram Schneider =
<wosch@FreeBSD.org> wrote:
>=20
> Hi,
>=20
> I wrote a script that finds new "mandoc -T lint" warnings in
> manual pages, per git commit. Running mandoc -T lint on a page with
> existing warnings does not tell you whether your change made things
> better or worse. mandoc-lint-regression.sh lints the old and the new
> version of every manual page a commit touches and reports only the
> difference: the warnings that were introduced, and the ones that were
> fixed. It is a plain /bin/sh script and needs only git, mandoc(1) and
> file(1). It works on commits, on uncommitted changes, and on a whole
> directory tree.
>=20
> Some things you can do with it, inside a freebsd-src checkout:
>=20
> # check your changes before you commit them
> mandoc-lint-regression.sh unstaged
>=20
> # your own commits of the last 90 days, as author or committer
> mandoc-lint-regression.sh -A -D 90
>=20
> # all commits of the last 7 days that touch a manual page
> mandoc-lint-regression.sh -D 7
>=20
> # which manual pages in the tree have errors? (no style messages)
> mandoc-lint-regression.sh -W error -s .
>=20
> The exit status is 1 if a new warning was introduced, so the script
> also works as a pre-commit hook ("mandoc-lint-regression.sh staged")
> and in CI. Checking all manual pages in the tree takes about 15
> seconds here.
>=20
> Download, documentation and more examples:
>=20
> https://people.freebsd.org/~wosch/src/mandoc-lint-regression/
>=20
> Feedback and bug reports are welcome.
Hi wosch@!
I=E2=80=99m game for adding this to CI (GHA) and pre-commit if =
folks find it generally useful. I=E2=80=99m working on porting over some =
things from the ATF/kyua/lutok projects to help with contributions made =
on GitHub.
Are there any plans for adding this script to ports or src?
Thank you for the help :)!
-Enji=
--Apple-Mail=_FE2B07B2-F428-458F-B875-3265188B1AD8
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEkHfexGRJ3gYRdA2gGpE5DjPsNJgFAmr/Ps4ACgkQGpE5DjPs
NJhecg//US4cNBSJz5oX0vWlKVILnXpeVGOQuW1VIld+WJwKdFpOEVnnatjF4Uj9
hCV+k0FixCC0fQpI9/tgeal3EeVudN8PKk1N76L7DDQ3cTgcR0qq27EFqtipHj7E
a7EJHNVtNgWzIh7IWSVPeZcsiGqOsmnRWAq1+yeoLM2pVeSOumQnVcwMde484gPD
kA53PzCpaRyBQuXnAIp8Bx8iWNAkMA0BJ39IXrpW6sm7o0TFZWVbOLJFcGRZqXum
BwGbIksbXBusizWQODctFxtrs0Z/tVyylZH9/W/G/Ms7ewzRtixplL2T8uchLOGW
sivkX5rNzMrv5Z+18gDauGVEfGe6rKhOoE4mv5YA24KVZqDeP5GNmOEoPX3mWwDT
0F502ucdnQZRdCXgXXLiZ1VfFXPDzCZMuXuRv+PekeXZBTEQIPd+H+BkxE+9tpPN
Dn1tRXvMlQJ5cLceYPZsJTxRZ+rBUHbN+M98MKW3YPzS+GJtjhVKg8QyvBJoB6cA
OgNgb6ZUteDf5Cd1CRxVLFiodDwG872BaXgDSxKbsUOTiam6gdZ/79R67stObmZB
y9Gz4s+EVa55z5CJ0sE7NMEQKpOQA8yz5M6bexiLPNxeKkV5TG0vJi7jmDgeC5Ra
Pc1GXSv5WZCOBYTIA7YDYSDvCwSBwi0V+BQGizZXGp23UVqlrRg=
=u5iY
-----END PGP SIGNATURE-----
--Apple-Mail=_FE2B07B2-F428-458F-B875-3265188B1AD8--
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<C79335D7-BEEF-4499-A83A-FA874C5A78A9@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailReferences:
<CAMWY7CAaDJPL76H72XJ1AGN49cUGxQe9FmUEHEb9y8v-V5rwAA@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: "Enji Cooper \(yaneurabeya\)" <yaneurabeya@gmail.com>
Newsgroups: muc.lists.freebsd.hackers
Subject: Re: mandoc-lint-regression.sh: catch new mandoc lint warnings before
you commit
Date: Thu, 19 Nov 2026 10:24:14 -0800
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <C79335D7-BEEF-4499-A83A-FA874C5A78A9@gmail.com>
References: <CAMWY7CAaDJPL76H72XJ1AGN49cUGxQe9FmUEHEb9y8v-V5rwAA@mail.gmail.com>
MIME-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.4\))
Content-Type: multipart/signed;
boundary="Apple-Mail=_FE2B07B2-F428-458F-B875-3265188B1AD8";
protocol="application/pgp-signature";
micalg=pgp-sha256
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
logging-data="52317"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
t=1795112671;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:cc:mime-version:mime-version:content-type:content-type:
in-reply-to:in-reply-to:references:references:list-id:list-help:
list-owner:list-unsubscribe:list-subscribe:list-post;
bh=//hYgqg/4W9pZd4IC2WxYdT8JrDvfk+2Ef/lF4CCu0k=;
b=XFdkJ8ygCPdekRoecMmDSE1JIf4vrHpTkBkpdtVoIoROkcHLA4GjysTheLE6VqLOpeeOdL
xf3+K1lsME9MRkNXg6SRx9UcnsROTjpmVjIVB9KNXhd7yKEaZKXhK1fw7jLwDXep4sO4dc
LeI9F02anuulz1A8AxfDPdEbLz07lJEOghWtNqM+Mz1fGpi520jt53PxGMqrx45Z6E+thF
hW6JVdD5uJH3z/yjBeAeq0jRZU8B3VNlirUvpz6gr9CkF87uxhHjMbjnVRVTeJqinjFKn0
0Wr3TuVZTRG2l7eL1YiuRuHeApQB8MN5r3lPAdAZziZGIDB75OrqhTl7WEIn9Q==
X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
dkim=pass header.d=gmail.com header.s=20260707 header.b=dFK8iM7R;
spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::42c as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com;
dmarc=pass (policy=none) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795112666; x=1795717466; darn=freebsd.org;
h=to:references:message-id:cc:date:in-reply-to:from:subject
:mime-version:content-type:from:to:cc:subject:date:message-id
:reply-to:content-type;
bh=//hYgqg/4W9pZd4IC2WxYdT8JrDvfk+2Ef/lF4CCu0k=;
b=dFK8iM7R1bMnkkxFH+AlsgOfK/KuDpsfOfOvkkKbeJ4HI20PfIqlk94rn02ZrJ+FNf
U0hvA+/xIy11xNQCCumYrfzgeecAi+c4KQ3L9JCbo6Okf3N/0YYxZzGQw5g8pj9kuER/
d/h4sOm2Muzrk1H9TMHjYju9B3K4e/8c1H784pR48v2qijygjiFNHkQkI+BnklX4Kjmy
OzjoBhnyxuv/osQISIsZ/9fq1Zti3ef0wn2r0M7u/r7C94yKPREVYksIlA96vbnc/Ux+
A+9AdbugPeHEdfa9oL1wDRbAGlpnRFVIsOC6fN6c+oKHJWDAf6bLRDgtJTPI+gqAN8Co
Lz/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795112666; x=1795717466;
h=to:references:message-id:cc:date:in-reply-to:from:subject
:mime-version:content-type:x-gm-gg:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=//hYgqg/4W9pZd4IC2WxYdT8JrDvfk+2Ef/lF4CCu0k=;
b=KzSkZ/xXIfrk9Zlsdw/eQtZ3cAAuT4Q/jQjIrAoekTbifLhWdlv45RqB9h7mgUvoY6
Yib2OK44kaCVUs0G8ejIUBgXQ+P1Mi/ucEAmLzYDqgzZpCK5geh5nO5XfUHp4tzOFbPX
soXoWLV/4GpIDx/DqJu5jJlYsEz9S+muFmZLJG4+TDhbbuJWk5gJiSdXfW1hMdxN8YAQ
vpnNdgCZW+JfOYAwGgYMW9g2WPDd87uvi5psXigDRMVm+s+/cukvoUmPAydLn4Kathoo
Bk2s45CvauwLp65jY3CW7Wl8CmglVT1EHpKqtL30b7Sdd3rsZhJp20jdP3zjjdWEsUgR
reDw==
X-Forwarded-Encrypted: i=1; AL+hErEOxDwkoxeMWT4BT3S2ndiAxCo6btyGE6eektbkFLtJs+70+bfHDdkndmpspj0xQ+mXO4pHO3XySqBFc+3J9wg=@freebsd.org
X-Gm-Message-State: APuU4Z9976MLVyUYlVBVqMtv/umFsHpftv1hqIFWRoi3limvvFGIJUIN
2/zTXKIAIWQs+oRSqXuIdWn74zLIjT5LDF/O7OaxCL3Ma8slAiVprsh+foaSKdtv
X-Gm-Gg: AYBFou3sdMBOy/RO1UvIOOPQeE5vRaCPPosOPgyor2owRGONCIfouqh0KQH52LfTPlK
xRQ+vK3Yj23rexVOyHiU2fkrmg4Q0Xalv4OgWcEJGzaA50HDRZrli5ZGpAU2Zf+CWxzXL+WJcCJ
4MnR5sK2sgLUKqib6t4RJ1qo0xiDfd4O1xLZ2mswS7BvNi82+gE7q0UWhWIc/94d4eRcaRWhDwn
whzUBBtAOBOSOwggBMfJo4NXhwJ2ZsLazY2RfLXdrHj5m9Q0llZtXzTZkk/I8R/SMjY73RR1/Te
bevX77Nw4CbxAxZmoq/tZ4qXDXROqK1jVbIbNKslNZPV2Somj9Nmd6MJw0XJUXNdCnjnK3jme7O
GUMqNY0ozhhscE9KvoLpA2BkGm7hcRp7HtxB/wj27beLfB24B5REsXFxoytk46/0Q8zZJnsOXs7
RFgmGX8Dhy7uHcd5zgj7nn9MKJXhxEYY+cnlUk1Q96bt8TTzl0jMDSktEiUbQOiD3SYiOdfVxfW
t2IXX+SgUbtE/jTEPiUxFckxlurA8Hm5QlB7JdFZNP4i4dQIsGZ2kivh1MFNEGhso8p+LPtCAli
NWn9I0v/lrbJGBq1O+6jpCclqirsUQAseIbiYw4oYoHqiEEq5NU=
Precedence: list
In-Reply-To: <CAMWY7CAaDJPL76H72XJ1AGN49cUGxQe9FmUEHEb9y8v-V5rwAA@mail.gmail.com>
X-Rspamd-Queue-Id: 4jVn1S1Pxyz4Yf4
X-Spamd-Bar: --
X-Spamd-Result: default: False [-2.60 / 15.00];
SIGNED_PGP(-2.00)[];
MV_CASE(0.50)[];
DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
R_DKIM_ALLOW(-0.20)[gmail.com:s=20260707];
R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56:c];
MIME_GOOD(-0.20)[multipart/signed,text/plain];
RCVD_TLS_LAST(0.00)[];
ARC_NA(0.00)[];
FROM_HAS_DN(0.00)[];
MIME_TRACE(0.00)[0:+,1:+,2:~];
FREEMAIL_ENVFROM(0.00)[gmail.com];
HAS_ATTACHMENT(0.00)[];
FREEMAIL_FROM(0.00)[gmail.com];
TO_DN_SOME(0.00)[];
DKIM_TRACE(0.00)[gmail.com:+];
ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::42c:from];
TO_MATCH_ENVRCPT_SOME(0.00)[];
RCVD_COUNT_TWO(0.00)[2];
FROM_EQ_ENVFROM(0.00)[];
RCPT_COUNT_THREE(0.00)[3];
PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org];
MID_RHS_MATCH_FROM(0.00)[];
MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org];
RCVD_VIA_SMTP_AUTH(0.00)[];
DWL_DNSWL_NONE(0.00)[gmail.com:dkim]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes