refactor(rename): kb → kebab — binary, env vars, XDG paths, file renames
두 번째 commit. 사용자 facing surface (CLI binary, env vars, XDG paths) + 코드 안 single-letter token (`KB_`, `kb.sqlite`, `/kb/`, tracing target) 일괄 rename. 그리고 3 개 file rename: - 디자인 doc `2026-04-27-kb-final-form-design.md` → `2026-04-27-kebab-final-form-design.md` - 최초 보고서 `kb_local_rust_report.md` → `kebab_local_rust_report.md` - workspace ignore `.kbignore` → `.kebabignore` ## 변경 - `crates/kebab-cli/Cargo.toml`: `[[bin]] name = "kb"` → `"kebab"`. - `crates/kebab-cli/src/main.rs`: `#[command(name = "kb", …)]` → `name = "kebab"`. - 모든 `KB_*` env var (코드 + doc + 테스트) → `KEBAB_*`. apply_env prefix 매칭 + 30+ 개 setting 키 모두. - XDG paths: `~/.config/kb` / `~/.local/share/kb` / `~/.cache/kb` / `~/.local/state/kb` → `~/.config/kebab` 등. config defaults + expand_path tests + paths.rs 의 hardcode 모두. - SQLite filename: `kb.sqlite` → `kebab.sqlite` (`SQLITE_FILE` const + 테스트 hardcode 모두). - tracing target: `target: "kb-*"` → `"kebab-*"` (10+ 곳). - snapshot fixture: `.kbignore` → `.kebabignore` (`fixtures/source-fs/ tree-1.snapshot.json` 갱신). ## 검증 - `cargo test --workspace -j 1` clean (linker OOM 회피 위해 직렬). - `cargo clippy --workspace --all-targets -- -D warnings` clean. 다음 commit 에서 docs sweep. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
//! │ ├── alpha.md
|
||||
//! │ └── beta.md
|
||||
//! ├── ignored/
|
||||
//! │ └── skip.tmp # excluded by .kbignore
|
||||
//! ├── .kbignore # contains: *.tmp
|
||||
//! │ └── skip.tmp # excluded by .kebabignore
|
||||
//! ├── .kebabignore # contains: *.tmp
|
||||
//! └── .DS_Store # implicitly excluded
|
||||
//! ```
|
||||
//!
|
||||
@@ -52,7 +52,7 @@ fn cfg_for_fixture(root: &str) -> Config {
|
||||
let mut c = Config::defaults();
|
||||
c.workspace.root = root.to_string();
|
||||
// Clear default excludes (`.git/**`, `node_modules/**`, `.obsidian/**`)
|
||||
// so the snapshot is purely a function of the fixture + .kbignore +
|
||||
// so the snapshot is purely a function of the fixture + .kebabignore +
|
||||
// baked-in default-excludes.
|
||||
c.workspace.exclude.clear();
|
||||
c
|
||||
@@ -101,18 +101,18 @@ fn scan_and_strip() -> Value {
|
||||
fn tree_1_snapshot_matches_baseline() {
|
||||
let actual = scan_and_strip();
|
||||
|
||||
// If KB_REGEN_SNAPSHOT is set, (re)write the baseline and exit
|
||||
// If KEBAB_REGEN_SNAPSHOT is set, (re)write the baseline and exit
|
||||
// *before* attempting to read it. This is the only path that may
|
||||
// create the file from scratch.
|
||||
if std::env::var_os("KB_REGEN_SNAPSHOT").is_some() {
|
||||
if std::env::var_os("KEBAB_REGEN_SNAPSHOT").is_some() {
|
||||
let pretty = serde_json::to_string_pretty(&actual).unwrap() + "\n";
|
||||
std::fs::write(baseline_path(), pretty).expect("write baseline");
|
||||
panic!("regenerated baseline; rerun without KB_REGEN_SNAPSHOT to verify");
|
||||
panic!("regenerated baseline; rerun without KEBAB_REGEN_SNAPSHOT to verify");
|
||||
}
|
||||
|
||||
let baseline_text = std::fs::read_to_string(baseline_path()).unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"missing baseline at {} — regenerate via `KB_REGEN_SNAPSHOT=1 cargo test \
|
||||
"missing baseline at {} — regenerate via `KEBAB_REGEN_SNAPSHOT=1 cargo test \
|
||||
-p kb-source-fs --test snapshot_tree1 -- tree_1_snapshot_matches_baseline`",
|
||||
baseline_path().display()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user