public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Jakub Wilk <jwilk@jwilk.net>,
	linux-man@vger.kernel.org, Alejandro Colomar <alx@kernel.org>,
	Mike Frysinger <vapier@chromium.org>,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Stefan Puiu <stefan.puiu@gmail.com>
Subject: Re: [PATCH] INSTALL, Makefile, cmd.mk, lint-man.mk: Lint about '\" t' comment for tbl(1)
Date: Wed, 9 Nov 2022 22:58:03 +0700	[thread overview]
Message-ID: <Y2vOC3VJWAg3K141@vapier> (raw)
In-Reply-To: <20221109151812.58365-1-alx@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

On 09 Nov 2022 16:18, Alejandro Colomar wrote:
> --- a/lib/lint-man.mk
> +++ b/lib/lint-man.mk

i guess not a new issue, but it feels like writing lint logic in Makefiles
is not the best use of time.  this logic is really hairy.

> +$(_LINT_man_tbl): $(_LINTDIR)/%.lint-man.tbl.touch: $(MANDIR)/% | $$(@D)/.
> +	$(info LINT (tbl)	$@)
> +	if $(GREP) '^\.TS$$' <$< >/dev/null && ! $(HEAD) -n1 <$< | $(GREP) '\\" t$$' >/dev/null; then \

POSIX grep has a -q option so you don't have to redirect to /dev/null.
	if $(GREP) -q '^\.TS$$' <$< && ...

also, is there a reason you're using a redirect instead of just passing the
file to grep ?  the redirect works, but it seems to contribute to general
"this code is hard for humans to read".  i don't think you really need to
be concerned with files starting with dashes ...
	if $(GREP) -q '^\.TS$$' $< && ...

or more completely:
	if $(GREP) -q '^\.TS$$' $< && ! $(HEAD) -n1 $< | $(GREP) -q '\\" t$$'; then

> +	fi;

don't need this trailing semi-colon
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2022-11-09 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 15:18 [PATCH] INSTALL, Makefile, cmd.mk, lint-man.mk: Lint about '\" t' comment for tbl(1) Alejandro Colomar
2022-11-09 15:40 ` Alejandro Colomar
2022-11-09 15:42   ` Alejandro Colomar
2022-11-09 15:53     ` Alejandro Colomar
2022-11-09 15:58 ` Mike Frysinger [this message]
2022-11-09 17:06   ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y2vOC3VJWAg3K141@vapier \
    --to=vapier@gentoo.org \
    --cc=alx.manpages@gmail.com \
    --cc=alx@kernel.org \
    --cc=g.branden.robinson@gmail.com \
    --cc=jwilk@jwilk.net \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=stefan.puiu@gmail.com \
    --cc=vapier@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox