All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Chaignon <paul@cilium.io>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] Exit with non-zero status
Date: Wed, 29 Apr 2020 21:07:34 +0200	[thread overview]
Message-ID: <20200429190733.GA5695@Mem> (raw)
In-Reply-To: <b6c5ae24-f24c-a0d5-796a-8e9cbd17a7d6@web.de>

On Wed, Apr 29, 2020 at 08:40:10PM +0200, Markus Elfring wrote:
> > I am trying to exit spatch with a non-zero exit status when required
> > changes have been found.
> 
> I got used to the interpretation that a zero exit status
> should indicate a successful execution of the program.

I agree, but I guess what successful execution means is a matter of
perspective. For example, grep returns a non-zero exit status when it
doesn't match anything. Yet, I generally consider that a successful
execution when I use grep.

> 
> 
> >   @finalize:python@
> >   @@
> >   exit(cnt)
> >
> > where cnt is incremented by another Python rule everytime a required
> > change is found.
> 
> I suggest to handle the desired search result counter
> by an other data processing interface.
> How would you like to treat program execution failures otherwise?

I'm trying to run SmPL programs as part of a CI pipeline, so execution
failure and (buggy) code pattern not found really mean the same in
the end: a human needs to take a look :-)

I understand that is not a common use case and I'm fine using a
workaround. Just wanted to check I wasn't missing something obvious.

Cheers,
Paul

> 
> Regards,
> Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  reply	other threads:[~2020-04-29 19:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 18:40 [Cocci] Exit with non-zero status Markus Elfring
2020-04-29 19:07 ` Paul Chaignon [this message]
2020-04-29 19:50   ` Markus Elfring
2020-05-05  9:59     ` Paul Chaignon
2020-05-05 11:08       ` Markus Elfring
2020-05-06 12:01         ` Paul Chaignon
2020-05-06 12:24           ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-04-29 14:39 Paul Chaignon
2020-04-29 15:07 ` Julia Lawall
2020-04-29 15:16   ` Paul Chaignon
2020-04-29 15:25     ` Julia Lawall

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=20200429190733.GA5695@Mem \
    --to=paul@cilium.io \
    --cc=Markus.Elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.