Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
444 changes: 215 additions & 229 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions cot-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ cot-cli = { workspace = true, features = ["test_utils"] }
cot.workspace = true
glob.workspace = true
libtest-mimic.workspace = true
schemars = { workspace = true, features = ["std"] }
serde_json.workspace = true
thiserror.workspace = true

[features]
# Enables generating the configuration file reference (docs/configuration.md).
config-docs = ["cot/full", "cot/_internal_config-docs"]

[lints]
workspace = true

[[test]]
name = "doc_code_blocks"
path = "tests/doc_code_blocks.rs"
harness = false

[[test]]
name = "config_reference"
path = "tests/config_reference.rs"
required-features = ["config-docs"]

[[bin]]
name = "generate_config_docs"
path = "src/bin/generate_config_docs.rs"
required-features = ["config-docs"]
24 changes: 24 additions & 0 deletions cot-test/src/bin/generate_config_docs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//! Regenerates `docs/configuration.md` from `cot::config::ProjectConfig`'s type
//! definition.
//!
//! Run via `just generate-config-docs`.

use std::path::PathBuf;

fn main() {
let content = cot_test::config_reference::generate_config_reference();

let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let docs_path = manifest_dir
.parent()
.expect("failed to get workspace path")
.join("docs")
.join("configuration.md");

std::fs::write(&docs_path, content).expect("failed to write docs/configuration.md");
println!("Wrote {}", docs_path.display());
}

// TODO: make table nicer
// TODO: better defaults for enums
// TODO: links for "see below"
Loading
Loading