Jesús Pérez c62e967ce3
chore: complete KCL to Nickel migration cleanup and setup pre-commit
Clean up 404 KCL references (99.75% complete):
   - Rename kcl_* variables to schema_*/nickel_* (kcl_path→schema_path, etc.)
   - Update functions: parse_kcl_file→parse_nickel_file
   - Update env vars: KCL_MOD_PATH→NICKEL_IMPORT_PATH
   - Fix cli/providers-install: add has_nickel and nickel_version variables
   - Correct import syntax: .nickel.→.ncl.
   - Update 57 files across core, CLI, config, and utilities

   Configure pre-commit hooks:
   - Activate: nushell-check, nickel-typecheck, markdownlint
   - Comment out: Rust hooks (fmt, clippy, test), check-yaml

   Testing:
   - Module discovery: 9 modules (6 providers, 1 taskserv, 2 clusters) 
   - Syntax validation: 15 core files 
   - Pre-commit hooks: all passing 
2026-01-08 20:08:46 +00:00

35 lines
965 B
Plaintext

use setup/utils.nu setup_config_path
export def setup_user_context_path [
defaults_name: string = "context.yaml"
] {
let str_filename = if ($defaults_name | into string) == "" { "context.yaml" } else { $defaults_name }
let filename = if ($str_filename | str ends-with ".yaml") {
$str_filename
} else {
$"($str_filename).yaml"
}
let setup_context_path = (setup_config_path | path join $filename )
if ($setup_context_path | path exists) {
$setup_context_path
} else {
""
}
}
export def setup_user_context [
defaults_name: string = "context.yaml"
] {
let setup_context_path = setup_user_context_path $defaults_name
if $setup_context_path == "" { return null }
open $setup_context_path
}
export def setup_save_context [
data: record
defaults_name: string = "context.yaml"
] {
let setup_context_path = setup_user_context_path $defaults_name
if $setup_context_path != "" {
$data | save -f $setup_context_path
}
}