-
-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to specify the return code for success #134
Comments
Original comment by @lvh Right. In my case, it's not super important; most of pyroma complains about is nice-to-haves, not fail-the-build. Invert would be marginally better for me, but accept all return codes would work fine too :) |
Original comment by @hpk42 Question is if |
Original comment by @lvh Prefix with a |
Original comment by @hpk42 You can already use an arbitrary code script from the dir where tox.ini is located:
so you can wrap command execution. That's not very convenient for a somewhat common case of declaring a non-zero returncode as acceptable, however. I am sometimes pondering implementing a subset of bash functionality so that it works also on windows. Something like this:
And allowing some |
Original comment by @lvh Also, people may want more complex expressions there, but I don't know if you want to allow that. I suppose at that point you're already doing arbitrary code execution, so what's another eval? :) |
Original comment by @lvh Hm. It's a hard issue. IIUC stuff is now interpolated, split and then passed to popen, so maybe something that's unlikely to occur in that string now. Also, maybe we need to add other metadata later. So, one thing that you could do is pretend it's a shell:
Maybe with a specific prefix that means "execute this in a shell", like:
Upside:
Two downsides:
Another option would be something along the lines of:
This can later be extended to something like I'm not a huge fan of either of these, but that's what came up in my head :) |
Original comment by @hpk42 any suggestion for syntax? |
The interest in this seems to be minor, so I would propose to close this as wontfix or at least not introduce it in the old format but only in #999 |
cc @lvh |
Sure, I have no more interest in this. I fixed it, years ago, by fixing the return code of said piece of software. |
I'll propose as won't fix this. Return code zero is success and we should prefer that, I would propose people to wrap call if they really have to support software with non zero exit value. |
Right now, tox assumes that a return code of 0 means "success". That's almost always true, but I've ran into a case where it isn't.
While, arguably, that's a bug in the thing that I'm running, it would be nice if there was a way to specify the expected return code, so I don't have to do crude hacks like:
The text was updated successfully, but these errors were encountered: