bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: "bug-gnulib@gnu.org List" <bug-gnulib@gnu.org>
Subject: Re: sc_prohibit_magic_number_exit false positive on string
Date: Sun, 8 Sep 2019 08:19:16 -0700	[thread overview]
Message-ID: <CA+8g5KErj0BrwFeJrEUEdT=reegkAA_WPu66BKo0GR_MydK8XA@mail.gmail.com> (raw)
In-Reply-To: <20190908125619.qabhrayjeeium3du@tardis.localdomain>

On Sun, Sep 8, 2019 at 6:06 AM Darshit Shah <darnir@gnu.org> wrote:
> I just realized that the syntax check rule sc_prohibit_magic_number_exit will
> cause a false positive when it finds the relevant tokens within a string as
> well.
>
> For example, in Wget, we have the following snippet in our tests which trips
> this rule:
>
> > WGET_TEST_EXPECTED_FILES, &(wget_test_file_t []) {
> >       { "exit-status.txt", "exit(8)\n" },
> >       {       NULL } },
>
> I made a very tiny change to the rule in maint.mk(L408) to account for this:
>
> -exclude='exit \(77\)|error ?\(((0|77),|[^,]*)'         \
> +exclude='exit \(77\)|error ?\(((0|77),|[^,]*)|"(usage|exit|error).*"'          \

Hi Darshit, that feels a little too specific.
Did you consider exempting that file from this one check?
You can do that by adding a line like the following to cfg.mk:

exclude_file_name_regexp--sc_prohibit_magic_number_exit =
offending-file-regexp\.c$$


  reply	other threads:[~2019-09-08 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08 12:56 sc_prohibit_magic_number_exit false positive on string Darshit Shah
2019-09-08 15:19 ` Jim Meyering [this message]
2019-09-11 16:23   ` Darshit Shah

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to='CA+8g5KErj0BrwFeJrEUEdT=reegkAA_WPu66BKo0GR_MydK8XA@mail.gmail.com' \
    --to=jim@meyering.net \
    --cc=bug-gnulib@gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).