Doot: The Documentation

Doot is a TOML based Task Runner similar to doit. Probably use that instead of doot for the moment.

Introduction

Doot grew out of a desire for:

  1. a task runner with less esoteric cantations than make.

  2. a CLI that would respond to --help at all stages of trying to remember what I was doing.

  3. a toml based task specification format.

  4. straightfoward use of Python functions when custom actions are needed.

Overview

See the tasks available:

doot list

Resulting in:

----------------------------------------------
-------------------- Doot --------------------
----------------------------------------------
Defined Task Generators by Group:
*   docs::
         build               :: build sphinx project documentation                           :: <Source: /media/john/data/github/python/doot/.tasks/docs.toml>
         test                :: run sphinx doctest                                           :: <Source: /media/john/data/github/python/doot/.tasks/docs.toml>
*   precommit::
         validate            :: Validate a commit message.                                   :: <Source: /media/john/data/github/_templates/doot/repo_chores/precommit.toml>
*   test::
         pytest              :: run project tests                                            :: <Source: /media/john/data/github/_templates/doot/repo_chores/test.toml>
*   version::
         major               ::                                                              :: <Source: /media/john/data/github/_templates/doot/repo_chores/version.toml>
         minor               ::                                                              :: <Source: /media/john/data/github/_templates/doot/repo_chores/version.toml>
         bump                ::                                                              :: <Source: /media/john/data/github/_templates/doot/repo_chores/version.toml>
         changelog           :: Generates a changelog using git cliff                        :: <Source: /media/john/data/github/_templates/doot/repo_chores/version.toml>
*   requirements::
         pip                 :: Generate a requirements.txt                                  :: <Source: /media/john/data/github/_templates/doot/repo_chores/version.toml>

Full Task Name: {group}::{task}

Then run one of the tasks:

doot docs::build

Config Files

There are two main config file types.

  • doot.toml for configuring doot, and

  • task.toml files for describing tasks and their relations.

doot.toml

# -*- mode:conf-toml; -*-

[settings.general]
loaders                  = { commands="default", task="default", parser="default"}
location_check           = { make_missing = true }

[settings.tasks]
sources = [".tasks", "~/.config/.templates/doot/repo_chores"] # Files or directories where task specs can be loaded from, expanded according to [[locations]] keys
code    = []                                       # Directories where task specific code can be imported from, expanded according to [[locations]] keys
sleep   = { tasks=0.2, subtask=1, batch=1 }

[settings.commands]
# Settings for commands, like telling the 'run' command what backends to use
run  = { tracker="default", runner="default", reporter= "default", report-line=[] }
list = { hide=[] }

[plugins]
# Allows for defining aliases
command        = { tasks="doot.cmds.list_cmd:ListCmd", pl="doot.cmds.plugins_cmd:PluginsCmd" }

[logging]
# Standard loggers. See LoggerSpec.
stream  = { level="WARNING", filter=[],                 target="stdout", format="{levelname:<8} : {message}"  }
file    = { level="DEBUG",   filter=["tomlguard"],      target="rotate", format="{levelname:<8} : {message:<20} :|: ({module}.{lineno}.{funcName})", filename_fmt="doot.log" }
printer = { level="NOTSET",  colour=true,                target=["stdout", "rotate"], format="{message}", filename_fmt="doot_printed.log" }

[logging.subprinters]
default       = {level="WARNING"}
shutdown      = {level="WARNING",    format="Shutdown: {message}", target="stdout"}
cmd           = {level="INFO"}
task          = {level="INFO" }
header        = {level="INFO" }
task_header   = {level="INFO"}

[logging.extra]

[[locations]]
tasks        = ".tasks"
temp         = {loc=".temp", cleanable=true}
src          = {loc="doot", protected=true}
logs         = "{temp}/logs"

Task Toml

[[tasks.simple]]
name = "basic"
actions = [
       {do="log", msg="This is a really simple task"},
]

[[tasks.better]]
name = "chained"
depends_on = [ "simple::basic" ]
actions = [
       {do="log", msg="This runs after simple::basic has run"},
]

Repo and Issues

The repo for doot can be found here.

When you find a bug, bother me, unsurprisingly, on the issue tracker.