# This is a configuration file for the bacon tool
#
# Bacon repository: https://github.com/Canop/bacon
# Complete help on configuration: https://dystroy.org/bacon/config/
# You can also check bacon's own bacon.toml file
#  as an example: https://github.com/Canop/bacon/blob/main/bacon.toml

default_job = "check"

[jobs.check]
command = ["cargo", "xtask", "check"]
need_stdout = false

[jobs.check-all]
command = ["cargo", "xtask", "check", "--all-features"]
need_stdout = false

[jobs.check-crossterm]
command = ["cargo", "xtask", "check-backend", "crossterm"]
need_stdout = false

[jobs.check-termion]
command = ["cargo", "xtask", "check-backend", "termion"]
need_stdout = false

[jobs.check-termwiz]
command = ["cargo", "xtask", "check-backend", "termwiz"]
need_stdout = false

[jobs.clippy-all]
command = ["cargo", "xtask", "clippy"]
need_stdout = false

[jobs.test]
command = ["cargo", "xtask", "test"]
need_stdout = true

[jobs.test-unit]
command = ["cargo", "xtask", "test-libs"]
need_stdout = true

[jobs.doc]
command = ["cargo", "xtask", "docs"]
need_stdout = false

[jobs.doc-open]
command = ["cargo", "xtask", "docs", "--open"]
on_success = "job:doc"
need_stdout = false

[jobs.coverage]
command = ["cargo", "xtask", "coverage"]

[jobs.coverage-unit-tests-only]
command = ["cargo", "xtask", "coverage", "--lib"]

[jobs.hack]
command = ["cargo", "xtask", "hack"]

[jobs.format]
command = ["cargo", "xtask", "format"]

[jobs.zizmor-offline]
# zizmor checks the workflow files for security issues. The offline version is generally faster, but
# checks for fewer issues.
command = ["zizmor", "--color", "always", ".github/workflows", "--offline"]
need_stdout = true
default_watch = false
watch = [".github/workflows/"]

[jobs.zizmor-online]
# zizmor checks the workflow files for security issues. The online version is a bit slower, but it
# checks for more issues
command = ["zizmor", "--color", "always", ".github/workflows"]
need_stdout = true
default_watch = false
watch = [".github/workflows/"]

# You may define here keybindings that would be specific to
# a project, for example a shortcut to launch a specific job.
# Shortcuts to internal functions (scrolling, toggling, etc.)
# should go in your personal global prefs.toml file instead.
[keybindings]
ctrl-h = "job:hack"
ctrl-c = "job:check-crossterm"
ctrl-t = "job:check-termion"
ctrl-w = "job:check-termwiz"
v = "job:coverage"
ctrl-v = "job:coverage-unit-tests-only"
u = "job:test-unit"
n = "job:nextest"
f = "job:format"
z = "job:zizmor-offline"
shift-z = "job:zizmor-online"
