Coding Style¶
We use the black code style with a line length of 120 characters and trailing commas.
You can format the code with:
black --line-length 120
Please include type hints for every provider method you write. An overview of generic types is included below.
You can find our complete flake8 configuration in the tox.ini file.
Use is instead of == when comparing a variable to None, False, or True (see https://www.flake8rules.com/rules/E711.html):
if my_var is None:
... # do something
Data Sets¶
For each data set, please provide a comment with reference to the source and/or origin of the data. If the source is a wiki, please also include the date and time it was last checked.
We only accept new data if it’s coming from statistical sources, such as census or government institutions. This includes names and their distribution.
You may include multiple sources, but each name must come from a source. We will not accept names authored exclusively by contributors.
Name Lists¶
When you have long lists of names, please order them alphabetically. Keep the lines length as close as possible to 120 characters, without exceeding the limit.
Type Hints¶
typing.py
includes generic types that can be re-used throughout the codebase. Moreover, some type definitions are
included in other parts of the code. If you add a generic type, please specify its usage below:
Type |
Used for |
---|---|
|
When creating a variable in a |
|
Input for various |
|
Hue name, float value or integer range. |
|
String variable that can only have values |
Tests¶
Please add tests for all new providers.
When adding a new test class, please find its place in alphabetical order.