feat: portable cross-runtime code-simplification skill
ast-grep-driven detection + ranking into a JSON ledger, two-track apply (deterministic autofix + model span-edits), configurable report/apply modes. Rule packs for JS/TS, Python, Go, Rust, Java; Svelte/SvelteKit support via project tooling + opt-in grammar. Runtime-neutral SKILL.md (Agent Skills spec). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
pub fn decide(ready: bool, blocked: bool) -> bool {
|
||||
if ready == true {
|
||||
return false;
|
||||
}
|
||||
if blocked == false {
|
||||
return true;
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub fn price(base: i64, qty: i64, tax_rate: i64, discount: i64, shipping: i64) -> i64 {
|
||||
let mut total = base * qty;
|
||||
if qty > 0 {
|
||||
if tax_rate > 0 {
|
||||
if total > 5000 {
|
||||
total = total - discount;
|
||||
}
|
||||
}
|
||||
}
|
||||
total + shipping
|
||||
}
|
||||
Reference in New Issue
Block a user