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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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/config-docs"]
Comment on lines +21 to +27

[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"]
20 changes: 20 additions & 0 deletions cot-test/src/bin/generate_config_docs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//! 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());
}
Loading
Loading