Skip to content

Commit 6a7900a

Browse files
committed
Updates.
1 parent ace406c commit 6a7900a

35 files changed

Lines changed: 133 additions & 211 deletions

File tree

TaskCmd.idml renamed to .taskcmd

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
.tasks
22

33
.build
4-
.desc Builds in debug mode
4+
.desc Builds task commander in debug mode
55
.cmd cargo +stable build
66

77
.clean
8-
.desc Cleans all targets
8+
.desc Cleans all generated artifacts
99
.cmd cargo +stable clean
1010
.cmd rm -rf manual/book
1111

1212
.clippy
13-
.desc Runs clippy for all targets
13+
.desc Runs linter
1414
.cmd cargo +stable clippy --all-targets
1515

1616
.cov
@@ -24,12 +24,12 @@
2424
.cmd cargo +stable llvm-cov --no-cfg-coverage --html
2525

2626
.cov-html-open
27-
.desc Generates code coverage report in HTML format
27+
.desc Generates code coverage report in HTML format and opens in browser
2828
.cmd cargo +stable llvm-cov clean
2929
.cmd cargo +stable llvm-cov --no-cfg-coverage --html --open
3030

3131
.cov-badge
32-
.desc Generates the detailed code coverage badge
32+
.desc Generates code coverage badge
3333
.cmd cargo +stable llvm-cov clean
3434
.cmd cargo +stable llvm-cov --no-cfg-coverage --json --summary-only | coverio -l coverage -c --tag cov-badge
3535

@@ -38,23 +38,23 @@
3838
.cmd cargo +stable doc
3939

4040
.doc-private
41-
.desc Generates documentation
41+
.desc Generates private documentation
4242
.cmd cargo +stable doc --document-private-items
4343

4444
.doc-open
4545
.desc Generates documentation and opens in browser
4646
.cmd cargo +stable doc --open
4747

4848
.doc-private-open
49-
.desc Generates documentation and opens in browser
49+
.desc Generates private documentation and opens in browser
5050
.cmd cargo +stable doc --open --document-private-items
5151

5252
.fmt
5353
.desc Runs code formatter
5454
.cmd cargo +nightly fmt
5555

5656
.install
57-
.desc Builds and installs release version from local sources
57+
.desc Installs task commander from local sources
5858
.cmd cargo +stable install taskcmd --path . --force
5959

6060
.manual
@@ -69,17 +69,17 @@
6969
.task cov-badge
7070

7171
.serve
72-
.desc Serves the manual locally and rebuilds on changes
72+
.desc Serves manual locally
7373
.cmd cd manual && mdbook serve
7474

7575
.test
7676
.desc Runs tests in debug mode
7777
.cmd cargo +stable test
7878

7979
.testn
80-
.desc Runs tests in debug mode
80+
.desc Runs tests in debug mode using nextest
8181
.cmd cargo +stable nextest run
8282

8383
.uninstall
84-
.desc Uninstalls previously installed local version
84+
.desc Uninstalls previously installed task commander
8585
.cmd cargo +stable uninstall taskcmd

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "taskcmd"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["Dariusz Depta <depta@engos.de>"]
55
description = "Task commander"
66
documentation = "https://docs.rs/taskcmd"
@@ -11,7 +11,13 @@ categories = ["command-line-utilities"]
1111
edition = "2024"
1212
license = "MIT OR Apache-2.0"
1313
exclude = [
14-
"manual/"
14+
".gitignore",
15+
".taskcmd",
16+
"CODE_OF_CONDUCT.md",
17+
"rustfmt.toml",
18+
"adr",
19+
"manual",
20+
"tmBundle"
1521
]
1622

1723
[dependencies]

Taskfile.yml

Lines changed: 0 additions & 107 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# ADR-0001 Build task runner in Rust
2+
3+
## Date
4+
5+
**2026-01-03**
6+
7+
## Status
8+
9+
**Accepted**
10+
11+
## Context
12+
13+
Rust projects typically require a command runner to orchestrate common development workflows
14+
such as building, testing, linting, generating coverage reports, and releasing crates.
15+
16+
The de facto standard for this purpose is [go-task], a mature and widely adopted task runner
17+
implemented in Go. It is configured through `Taskfile.yml` and distributed as a standalone binary.
18+
19+
We have used [go-task] for several years across multiple non-trivial Rust projects and have gained
20+
substantial operational experience with it. This experience has helped us identify both the essential
21+
capabilities required from a task runner in the Rust ecosystem and the limitations of [go-task].
22+
23+
These observations motivated an evaluation of whether a purpose-built solution could better address
24+
the needs of Rust projects while retaining the simplicity of a standalone command runner.
25+
26+
## Decision
27+
28+
We build a new, independent task runner written in Rust for Rust project workflows.
29+
30+
## Decision Drivers
31+
32+
### Toolchain purity
33+
34+
[go-task] is implemented in Go. Even though it ships as a single binary,
35+
depending on it still means a Go-originated tool sits in the middle of an otherwise
36+
all-Rust toolchain and release pipeline.
37+
38+
### Distribution as a Rust crate
39+
40+
Shipping task runner as a installable crate for projects that are already standardized on `cargo`.
41+
42+
### A different task-definition format
43+
44+
[go-task]'s `Taskfile.yml` is YAML. The intent with a new task runner is to move
45+
away from YAML for task definitions in favor of a syntax better suited to the tool's
46+
own semantics without a need to build a DSL.
47+
48+
### Full control as a from-scratch project
49+
50+
Building task runner from the ground up means owning the feature roadmap, file format,
51+
and execution model directly. This also serves as a deliberate opportunity to design
52+
and ship a complete Rust CLI tool end-to-end.
53+
54+
## Consequences
55+
56+
### Positive
57+
58+
- The full toolchain for Rust-centric repositories can stay Rust-only,
59+
with no Go dependency required to build or run project tasks.
60+
- Full freedom to define the task file format and feature set to fit the
61+
workflows actually needed, rather than working within [go-task]'s existing model.
62+
63+
### Negative
64+
65+
- All maintenance burden shifts from an established upstream project onto
66+
task runner own development — no inherited community, issue triage, or battle-testing.
67+
- Task runner starts with a smaller feature set and ecosystem than [go-task]
68+
and will need time to reach maturity.
69+
- Anyone adopting a new task runner has to learn a new, non-standard task-definition
70+
syntax instead of reusing the widely known `Taskfile.yml` format.
71+
72+
[go-task]: https://taskfile.dev

adr/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Architecture Decision Records
2+
3+
| No. | Title |
4+
|---------------------------------------------|---------------------------|
5+
| [0001](./0001-build-task-runner-in-Rust.md) | Build task runner in Rust |

src/loader.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@ use std::fs::{read_dir, read_to_string};
99
/// are not reported precisely because such failures are expected to be rare.
1010
/// This function will just panic if the task definitions file is not accessible.
1111
pub fn load_definitions() -> Result<String> {
12+
let mut files = vec![];
1213
let paths = read_dir(".").expect("Failed to access current directory");
1314
for entry in paths.flatten() {
1415
let file_type = entry.file_type().expect("Failed to get file type");
1516
if file_type.is_file() {
16-
let file_name = entry.file_name();
17-
if file_name.eq_ignore_ascii_case("taskcmd.idml") {
18-
return Ok(read_to_string(file_name).expect("Failed to read task definitions file"));
17+
let file_name = entry.file_name().to_string_lossy().to_string();
18+
if file_name.ends_with(".taskcmd") {
19+
files.push(file_name);
1920
}
2021
}
2122
}
22-
Err(err_definitions_not_found())
23+
files.sort();
24+
if let Some(file_name) = files.first() {
25+
Ok(read_to_string(file_name).expect("Failed to read task definitions file"))
26+
} else {
27+
Err(err_definitions_not_found())
28+
}
2329
}

0 commit comments

Comments
 (0)