From e0e7dd3f2af6c1a2f486e68822a23a5a7b0e7dd1 Mon Sep 17 00:00:00 2001 From: "g.sartori" Date: Mon, 27 Jul 2026 11:01:58 +0200 Subject: [PATCH] Added ternary operator formatting in the groovy-developer skill --- .agents/skills/groovy-developer/SKILL.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.agents/skills/groovy-developer/SKILL.md b/.agents/skills/groovy-developer/SKILL.md index ab5ed7ded16..277bf4993aa 100644 --- a/.agents/skills/groovy-developer/SKILL.md +++ b/.agents/skills/groovy-developer/SKILL.md @@ -109,6 +109,16 @@ def length = text?.length() ?: 0 def firstTitle = books?.first()?.title ?: "No books" ``` +### Ternary Operator +```groovy +// Use ternary operators only for simple conditions. +// Split long ternary expressions into multiple lines. +// Align `?` and `:` branches for readability. +String message = condition + ? "Value when true" + : "Value when false" +``` + ### Spread Operator ```groovy // Spread operator for collections