From 2190f4031f2742bc619982d8a138ae74de3fd368 Mon Sep 17 00:00:00 2001 From: Emily Grace Seville Date: Tue, 3 Jan 2023 13:44:04 +1000 Subject: [PATCH] style-guide: add Range syntax (#9646) * style-guide: standardize range syntax * Simplify syntax for arbitraty integer placeholders * Describe syntax for arbitraty floats --- contributing-guides/style-guide.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contributing-guides/style-guide.md b/contributing-guides/style-guide.md index ffffe2ee37..17c476dd07 100644 --- a/contributing-guides/style-guide.md +++ b/contributing-guides/style-guide.md @@ -109,6 +109,17 @@ Example: - Use GNU-style **long options** (like `--help` rather than `-h`) when they are cross-platform compatible (intended to work the same across multiple platforms). - In other cases use short options (like `-h`). +## Range syntax + +All borders of integer and float ranges are included. If you wanna exclude +one border then use incremented or decremented values to do it: +`{{1..5}}` == `[1-6)`. + +- Use `{{from..to}}` syntax for closed ranges. +- Use `{{-infinity..to}}` or `{{from..infinity}}` syntax for integer partially closed ranges. +- Use `{{integer}}` syntax for values where any integer is valid. +- Use `{{float}}` syntax for values where any float is valid. + ## Placeholder syntax User-provided values should use the `{{placeholder}}` syntax