Skip to content

Commit

Permalink
update coding standards for enum usage
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbudd committed Jun 21, 2021
1 parent 54f930b commit 6ee01a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions devDocs/codingStandards.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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 `_()`
Expand Down

0 comments on commit 6ee01a5

Please sign in to comment.