1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

Run mandoc or groff instead of man.REAL to check man page

Also fix all warnings reported by mandoc and apply some of the recommendations
from https://liw.fi/manpages/.
This commit is contained in:
Erik Flodin
2024-11-24 20:51:45 +01:00
parent 24772e7b4b
commit 216d49ceef
3 changed files with 105 additions and 100 deletions

View File

@@ -1,6 +1,7 @@
"""Syntax checks"""
import os
import shutil
import pytest
@@ -77,7 +78,11 @@ def test_yamllint(pytestconfig, runner, yamllint_version):
def test_man(runner):
"""Check for warnings from man"""
run = runner(command=["man.REAL", "--warnings", "./yadm.1"])
if shutil.which("mandoc"):
command = ["mandoc", "-T", "lint"]
else:
command = ["groff", "-ww", "-z"]
run = runner(command=command + ["-man", "./yadm.1"])
assert run.success
assert run.out == ""
assert run.err == ""
assert "yadm - Yet Another Dotfiles Manager" in run.out