Thread View: muc.lists.freebsd.doc
1 messages
1 total messages
Started by Wolfram Schneider
Thu, 19 Nov 2026 11:18
mandoc-lint-regression.sh: catch new mandoc lint warnings before you commit
Author: Wolfram Schneider
Date: Thu, 19 Nov 2026 11:18
Date: Thu, 19 Nov 2026 11:18
46 lines
6189 bytes
6189 bytes
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.
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads