mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-10 01:54:49 +08:00
fix(dead-code): remove stale constants + dead function; add workspace_sessions_dir tests
Three dead-code warnings eliminated from cargo check: 1. KNOWN_TOP_LEVEL_KEYS / DEPRECATED_TOP_LEVEL_KEYS in config.rs - Superseded by config_validate::TOP_LEVEL_FIELDS and DEPRECATED_FIELDS - Were out of date (missing aliases, providerFallbacks, trustedRoots) - Removed 2. read_git_recent_commits in prompt.rs - Private function, never called anywhere in the codebase - Removed 3. workspace_sessions_dir in session.rs - Public API scaffolded for session isolation (#41) - Genuinely useful for external consumers (clawhip enumerating sessions) - Added 2 tests: deterministic path for same CWD, different path for different CWDs - Annotated with #[allow(dead_code)] since it is external-facing API cargo check --workspace: 0 warnings remaining 430 runtime tests passing, 0 failing
This commit is contained in:
@@ -9,27 +9,6 @@ use crate::sandbox::{FilesystemIsolationMode, SandboxConfig};
|
||||
/// Schema name advertised by generated settings files.
|
||||
pub const CLAW_SETTINGS_SCHEMA_NAME: &str = "SettingsSchema";
|
||||
|
||||
/// Top-level settings keys recognized by the runtime configuration loader.
|
||||
const KNOWN_TOP_LEVEL_KEYS: &[&str] = &[
|
||||
"$schema",
|
||||
"enabledPlugins",
|
||||
"env",
|
||||
"hooks",
|
||||
"mcpServers",
|
||||
"model",
|
||||
"oauth",
|
||||
"permissionMode",
|
||||
"permissions",
|
||||
"plugins",
|
||||
"sandbox",
|
||||
];
|
||||
|
||||
/// Deprecated top-level keys mapped to their replacement guidance.
|
||||
const DEPRECATED_TOP_LEVEL_KEYS: &[(&str, &str)] = &[
|
||||
("allowedTools", "permissions.allow"),
|
||||
("ignorePatterns", "permissions.deny"),
|
||||
];
|
||||
|
||||
/// Origin of a loaded settings file in the configuration precedence chain.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub enum ConfigSource {
|
||||
|
||||
Reference in New Issue
Block a user