Re: [Cocci] Exit with non-zero status

2020-04-29 Thread Markus Elfring
>> 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

Re: [Cocci] Exit with non-zero status

2020-04-29 Thread Paul Chaignon
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

Re: [Cocci] Exit with non-zero status

2020-04-29 Thread Markus Elfring
> 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. > @finalize:python@ > @@ > exit(cnt) > > where cnt is incremented by another

Re: [Cocci] Exit with non-zero status

2020-04-29 Thread Julia Lawall
On Wed, 29 Apr 2020, Paul Chaignon wrote: > On Wed, Apr 29, 2020 at 05:07:56PM +0200, Julia Lawall wrote: > > > > > > On Wed, 29 Apr 2020, Paul Chaignon wrote: > > > > > Hi everyone, > > > > > > I am trying to exit spatch with a non-zero exit status when required > > > changes have been found.

Re: [Cocci] Exit with non-zero status

2020-04-29 Thread Paul Chaignon
On Wed, Apr 29, 2020 at 05:07:56PM +0200, Julia Lawall wrote: > > > On Wed, 29 Apr 2020, Paul Chaignon wrote: > > > Hi everyone, > > > > I am trying to exit spatch with a non-zero exit status when required > > changes have been found. I have tried to add a rule with finalize:python > > and the

Re: [Cocci] Exit with non-zero status

2020-04-29 Thread Julia Lawall
On Wed, 29 Apr 2020, Paul Chaignon wrote: > Hi everyone, > > I am trying to exit spatch with a non-zero exit status when required > changes have been found. I have tried to add a rule with finalize:python > and the following code: > > @finalize:python@ > @@ > exit(cnt) > > where cnt is

[Cocci] Exit with non-zero status

2020-04-29 Thread Paul Chaignon
Hi everyone, I am trying to exit spatch with a non-zero exit status when required changes have been found. I have tried to add a rule with finalize:python and the following code: @finalize:python@ @@ exit(cnt) where cnt is incremented by another Python rule everytime a required change is