Pylint always exit zero

Answered

Since teamcity 2020.2 there is a python build step runner with pylint support which is great! The only issue I have is that it always runs with --exit-zero. I want my projects to always have no pylint issues, so I want pylint to _not_ be run with --exit-zero. Is that possible?

0
4 comments

Hello!

Yes indeed, this is the default behavior for pylint and flake as of now. The reason of this is to allow to define your own build failure condition instead of always failing on non-zero exit code. In particular, with "fail on specific text in log" condition you could make the build fail if certain inspection was reported. 

Unfortunately, the behavior is not changeable now, but in theory TeamCity could report the inspections as build failures, so the non-zero pyling execution would still indirectly fail the build. Could you please let me know if this logic would work better for you? 

0
Avatar
Permanently deleted user

Hi Fedor,

That logic would definitely be sufficient for me. As long as I can let my build fail if there are report inspections by pylint and flake8 (I intend on using flake8 as requirement for my builds as well).

Is this already possible, or is it a feature that will come in a future version of teamcity?

 

Edit: I just read your comment again, and will check if fail on specific text is enough for me.

0

Hello!

The "fail if text" option is already available, and the latter is only registered as https://youtrack.jetbrains.com/issue/TW-68583 with a plan to be fixed in one of 2020.2.X bugfix releases. Please feel free to vote or comment on it as you see fit.

0
Avatar
Permanently deleted user

Thank you for your quick answer!

Hopefully it won't take long to implement that feature.

0

Please sign in to leave a comment.