Article View: muc.lists.freebsd.doc
Article #87Re: mandoc-lint-regression.sh: catch new mandoc lint warnings before you commit
From: Wolfram Schneider
Date: Fri, 20 Nov 2026 09:13
Date: Fri, 20 Nov 2026 09:13
64 lines
7305 bytes
7305 bytes
On Thu, 19 Nov 2026 at 19:24, Enji Cooper (yaneurabeya)
<yaneurabeya@gmail.com> wrote:
>
>
> > On Nov 19, 2026, at 3:18 AM, Wolfram Schneider <wosch@FreeBSD.org> wrote:
> >
> > Hi,
> >
> > 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.
> >
> > Some things you can do with it, inside a freebsd-src checkout:
> >
> > # check your changes before you commit them
> > mandoc-lint-regression.sh unstaged
> >
> > # your own commits of the last 90 days, as author or committer
> > mandoc-lint-regression.sh -A -D 90
> >
> > # all commits of the last 7 days that touch a manual page
> > mandoc-lint-regression.sh -D 7
> >
> > # which manual pages in the tree have errors? (no style messages)
> > mandoc-lint-regression.sh -W error -s .
> >
> > 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.
> >
> > Download, documentation and more examples:
> >
> > https://people.freebsd.org/~wosch/src/mandoc-lint-regression/
> >
> > Feedback and bug reports are welcome.
>
>
> Hi wosch@!
> I’m game for adding this to CI (GHA) and pre-commit if folks find it generally useful. I’m 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 :)!
Making a port is on my wish list.
-Wolfram
--
Wolfram Schneider <wosch@FreeBSD.org> https://wolfram.schneider.org
--
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:
<CAMWY7CAHa4R_gTwsdfbw9eYKGjsEZJhbQYhrjLoFRe5z9=FGnw@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!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:
<C79335D7-BEEF-4499-A83A-FA874C5A78A9@gmail.com> <>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!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: Wolfram Schneider <wosch@freebsd.org>
Newsgroups: muc.lists.freebsd.doc
Subject: Re: mandoc-lint-regression.sh: catch new mandoc lint warnings before
you commit
Date: Fri, 20 Nov 2026 10:13:00 +0100
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <CAMWY7CAHa4R_gTwsdfbw9eYKGjsEZJhbQYhrjLoFRe5z9=FGnw@mail.gmail.com>
References: <C79335D7-BEEF-4499-A83A-FA874C5A78A9@gmail.com> <>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
logging-data="74689"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
t=1795165997;
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:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:list-id:list-help:
list-owner:list-unsubscribe:list-subscribe:list-post;
bh=D8yTWZDUJ7tNeqptVMGcS6GdJvh8uM448iN1/WhWiJg=;
b=LWQkcgHRGCEI4bjeXOazzEDuelYDEnKXbrXjLbDnLX3ZKYI+UvZH56z3FUzzmcnwey+ki1
ybIwquTll+bq70Cj/bnuxdHpDcUfpJ2PDwkk1oycq8xqk0ERTARsdOHPNpCoIwoLT0KyvD
fGxMOM5xzRjrjZo5vCk1wXrr+1muo4W2S52FjWo5gqlNvnCT6DFzdQZH+G69MA36YKQzi4
Atuw5diZpREmUKmYwlPgX7iBB1n70swi3gde8SVC9p1DdsAxa4c1Efjbi3oy6FjFUKw4gJ
GZE0bcnTWeWNbJtvIDPkCCghcaIEIlnNPE4g36uv1MS9HK6omFq5FbysBnHBXg==
X-Original-To: freebsd-doc@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
dkim=none;
dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none);
arc=pass ("google.com:s=arc-20260327:i=1");
spf=pass (mx1.freebsd.org: domain of wschnr@googlemail.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=wschnr@googlemail.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795165991; x=1795770791;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=D8yTWZDUJ7tNeqptVMGcS6GdJvh8uM448iN1/WhWiJg=;
b=ZIJ+/s+gyARPptvEhLPYflk2sW494eqIIi3kzr8xWcwHduLfrlSnz0sxu8BDwTv7jF
/ibGrgwwm/+H6pEW4eL3a82D8wanJEKbcvvfrkXgntM2f/p7zsa8CV0DfXeMSyNTjhER
xd5xUIIw33YDoxP5J6CfTx0kg2Yhn0LsAF88s3+kiUBavbkf92ndUh2w91NRWYaaJSsd
E2B1uyzDHDDrCmjiWwFMu1C5pO9xQs5bsL5wjcaX5Uqc1wab89SVJd/FbLzJvH3A6/W/
SyKv3zzRokhZ4lnQMkZC8zKCeQbIvh4hLyWvc3ogOt7P67B4mjg3NeNThzA+oazDvcc2
JPWw==
X-Gm-Message-State: APuU4Z9/naCpsEKWguLHicCNTKSTZlorZT3M7zmZ9gML+ScQASMati1k
dhe70yAj415vqmMQui9LfZz5wFh7wcFhCyqAVcEYuyYT2uGxg3SG58jiMqO2V9Lxeizhx+W+I9a
N+okYnGC20X0nVYnYOf3oU2s1UKOki6Y=
X-Gm-Gg: AYBFou2wmyD5rZU03aHRAgvBX566XU+JcS+WkQMMLP86QSk2VfqX2xf64fjhbDHqj5z
P7JiOuCVMzlXi+8trq4IeubxIb18zGNAnnEIXBSCPhqDcCQ42BOLvs+I/gLVW76A2bQ08tK0CQZ
axLaj5PsrIrORsm0OC4/0Z7N0pWe7JAB7ikZTWQAmbOe34qVItFVXlqlZcOwaaO3KKE93CvNZIC
Dx0AacdZ+C3geKUyKdUeuenI2rL8xAg5ej5X3nH//7DJDe1Prsc/vsb16MH0v1twxpfqMDc/vkO
R7nU92IsadFUiHFyDiGcGAuDUZZQB9a4pDxpfMd1YPwPZbaZgbN3kIafaI50i4mAAaBrkAt4mQn
rRTl22mNUvPa0KOWpwPBmXhvJolBjV9ufdyWLbdfQ2MMl3jq7GfxJBiecS/0l/27nd9wMBM3bfP
z3OFngxrhdt3NinPj8
Precedence: list
In-Reply-To: <C79335D7-BEEF-4499-A83A-FA874C5A78A9@gmail.com>
X-Gm-Features: Aa3M54o7cT5DFpVhgAz-alaePxYnIX5KjiDPsGRtI9J2ljupTCzAvOF4urH0swU
X-Rspamd-Queue-Id: 4jW8kw5swtz4lWx
X-Spamd-Bar: /
X-Spamd-Result: default: False [-0.90 / 15.00];
ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1];
FORGED_SENDER(0.30)[wosch@freebsd.org,wschnr@gmail.com];
R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c];
DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none];
MIME_GOOD(-0.10)[text/plain];
RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.52:from];
ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US];
MIME_TRACE(0.00)[0:+];
RCVD_COUNT_ONE(0.00)[1];
FREEMAIL_ENVFROM(0.00)[gmail.com];
TO_DN_SOME(0.00)[];
FREEMAIL_TO(0.00)[gmail.com];
R_DKIM_NA(0.00)[];
MLMMJ_DEST(0.00)[freebsd-doc@freebsd.org];
RCVD_IN_DNSWL_NONE(0.00)[209.85.128.52:from];
FROM_HAS_DN(0.00)[];
FROM_NEQ_ENVFROM(0.00)[wosch@freebsd.org,wschnr@gmail.com];
MISSING_XM_UA(0.00)[];
TO_MATCH_ENVRCPT_SOME(0.00)[];
RCVD_TLS_LAST(0.00)[];
PREVIOUSLY_DELIVERED(0.00)[freebsd-doc@freebsd.org];
ALIAS_RESOLVED(0.00)[];
RCPT_COUNT_THREE(0.00)[3]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes