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 incremented by another Python rule everytime a required
> change is found. This works as expected except for the --in-place option
> which becomes ineffective.
>
> Is this a bug, or is finalize:python not intended to be used in that
> manner? Is it possible to overwrite spatch's exit status?

I'm actually surprised that this would ever work...

Finalize was intended for processing information in general, eg printing
some statistics about what was matched.

Would it be feasible to print cnt instead?

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to