Skip to main content

coding_tools/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Jonathan Shook
3
4//! Shared library for the `coding_tools` command-line suite.
5//!
6//! The binaries (`ct` and the `ct-*` tools it dispatches to) are thin
7//! front-ends over the reusable, doctested pieces collected here.
8//!
9//! Cross-cutting surfaces, used by several commands:
10//!
11//! * [`pattern`] — the shared substring → glob → regex promotion that every
12//!   pattern-accepting option uses.
13//! * [`walk`] — the shared file-selection predicates (`--base`/`--name`/`--type`
14//!   /`--size`/`--hidden`/`--follow`) that `ct-search`/`ct-edit`/`ct-patch`/
15//!   `ct-tree` target with.
16//! * [`verdict`] — the shared `SUCCESS`/`ERROR` outcome, its exit-status
17//!   mapping, and the count [`Expect`](verdict::Expect)ation that frames a
18//!   search/edit/patch as a pass/fail test.
19//! * [`template`] — the `{TOKEN}` substitution engine behind every `--emit`
20//!   verdict template.
21//! * [`allowlist`] — `ct-test`'s fixed, read-only command allow-gate.
22//! * [`explain`] — the `--explain` agent-documentation format selector.
23//!
24//! Per-command surfaces (the pure logic each `ct-*` tool is built on):
25//!
26//! * [`view`] — `ct-view`'s range parsing and context-window merging.
27//! * [`tree`] — `ct-tree`'s line/word/character counts and grouping.
28//! * [`edit`] — `ct-edit`'s line-scoped, byte-preserving replacement engine.
29//! * [`patch`] — `ct-patch`'s node-path / predicate / value parsing.
30//! * [`testrun`] — `ct-test`'s `--focus` output distiller.
31
32pub mod allowlist;
33pub mod edit;
34pub mod explain;
35pub mod patch;
36pub mod pattern;
37pub mod template;
38pub mod testrun;
39pub mod tree;
40pub mod verdict;
41pub mod view;
42pub mod walk;