From 4d19645d49b145a34bcb36eeb3b70ef089c55ba9 Mon Sep 17 00:00:00 2001 From: dana Date: Sat, 16 Jun 2018 11:49:20 -0500 Subject: 43031: Add note to style guide about variant syntax --- Etc/completion-style-guide | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Etc/completion-style-guide') diff --git a/Etc/completion-style-guide b/Etc/completion-style-guide index a6fc737a7..ca99c828b 100644 --- a/Etc/completion-style-guide +++ b/Etc/completion-style-guide @@ -20,6 +20,26 @@ Coding style: * Please try not to use lines longer than 79 characters. Don't worry about breaking long `_arguments' or `_values' specs though. +* Never use alternative, unusual, or optional syntax in completion + functions (or any other shell code distributed with zsh). In other + words, do NOT use the following: + + # Short loops + for x in $y; myfunc $x + + # Alternative forms + if { [[ $x == $y ]] } { + myfunc $x + } + foreach x in $y { + myfunc $x + } + + # Weird tricks + () for 1 { + myfunc $1 + } $x + Descriptions: Descriptions should not have a trailing full stop and initial capital -- cgit 1.4.1