Canop / bacon

background rust code check
https://dystroy.org/bacon
GNU Affero General Public License v3.0
1.96k stars 73 forks source link

`on_success` doesn’t trigger when there are warnings and `allow_warnings = true` #179

Closed narpfel closed 7 months ago

narpfel commented 7 months ago

Based on the documentation for allow_warnings, I would expect that when allow_warnings = true, on_success is triggered even when there are warnings:

if true, the action is considered a success even when there are warnings.

Minimal example (in an empty cargo project, current bacon main 018a2c85a2c223df85df3462caba5eca8da2d969):

default_job = "check"

[jobs.check]
command = ["cargo", "check", "--color", "always"]
need_stdout = false

[jobs.produce-warning]
command = ["echo", "\u001B[1m\u001B[33mwarning\u001B[0m:", "something"]
need_stdout = true
allow_warnings = true
on_success = "back"

[keybindings]
c = "job:check"
p = "job:produce-warning"

I’d like to be able to press p while in the check job, execute the produce-warning job and then automatically go back the the previous job. Is this possible?

If not, should this be possible?

My use case is that I want to run cargo llvm-cov --branch --open and return to the previous job (similar to cargo doc --open). However, cargo-llvm-cov unconditionally warns that --branch is unstable and there is no way to deactivate that warning.

Canop commented 7 months ago

Your expectation seems reasonnable.