From 6ee01a53eb8fa306c23ad60d5592432cf0e1f1c5 Mon Sep 17 00:00:00 2001 From: buddsean Date: Mon, 21 Jun 2021 15:25:35 +1000 Subject: [PATCH] update coding standards for enum usage --- devDocs/codingStandards.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devDocs/codingStandards.md b/devDocs/codingStandards.md index f504a1abb70..d44a5123c79 100644 --- a/devDocs/codingStandards.md +++ b/devDocs/codingStandards.md @@ -44,6 +44,7 @@ for more information. - E.G. `BrailleHandler`. * Constants should be all upper case, separating words with underscores; - E.G. `LANGS_WITH_CONJUNCT_CHARS`. + - Avoid unnecesary shared prefixes in constants. Instead, use an enum for related constants. * Event handlers are prefixed with "event_", subsequent words in camel case. Note, `object` and `action` are separated by underscores. - E.G.: `event_action` or `event_object_action`. @@ -59,6 +60,13 @@ for more information. - TBD. Ideally follows a similar style the others, and communicates if the filtering happens before or after some action. - It would also be nice to have a naming scheme that differentiates it from the others. +* Enums should be formatted using the expected mix of above eg: + ```python + class ExampleGroupOfData(Enum): + CONSTANT_VALUE_MEMBER = auto() + @property + def _formatMember(self): pass + ``` ### Translatable Strings * All strings that could be presented to the user should be marked as translatable using the `_()`