@@ -7,12 +7,17 @@ enhancements to the code.
77To help smooth out the contributions, here are some guidelines of conventions
88used in the code (the list will evolve over time):
99
10- - The maximum line length is 89 in Python files and 80 in the documentation.
10+ ## General
11+
12+ - If you find anything not in line with these guidelines, it is because this
13+ repository takes the approach of "if youchange it please align it to the
14+ current standards". Please correct the code to follow these guidelines.
15+
16+ ## Code
17+
18+ - The maximum line length is 89 in Python files.
1119- Import modules as namespaces. For example, instead of ` from enum import auto `
1220 use ` import enum ` and then ` enum.auto ` .
13- - In tests, preferable use parameterization instead of a for loop in the test
14- body.
15- - Use passive language in documentation.
1621- Use the following pattern for docstring:
1722
1823 ``` Python
@@ -42,14 +47,23 @@ used in the code (the list will evolve over time):
4247- In error messages, explain what has gone wrong and how to fix it.
4348- If an argument is optional in a function, any functions that it calls should
4449 no longer make the argument optional.
45- - Take not of the tools used in the pipeline for code quality checks. Any
50+ - Take note of the tools used in the pipeline for code quality checks. Any
4651 disabling of any check must be documented with a reason.
4752- Note changes in the changelog.
4853- Any raised exceptions should inherit from
4954 ` open_alchemy.exceptions.BaseError ` . Exception handling should specify which
5055 exception is being handled (e.i. more specific than ` Exception ` .
5156- Update the readme with any significant new features
5257- Update the documentation and examples, if appropriate
58+ - Functions that are intended for re-use across the code base (e.g. helper
59+ functions) should use keyword only arguments for increased clarity. Private
60+ module/ class functions may optionally use positional arguments for enhanced
61+ execution speed.
62+
63+ ## Tests
64+
65+ - In tests, preferable use parameterization instead of a for loop in the test
66+ body.
5367- Test docstrings should use the following structure:
5468
5569 ``` Python
@@ -62,7 +76,13 @@ used in the code (the list will evolve over time):
6276
6377- Separate the code for GIVEN, WHEN and THEN in tests using a single blank line
6478 to indicate where each piece starts
65- - Functions that are intended for re-use across the code base (e.g. helper
66- functions) should use keyword only arguments for increased clarity. Private
67- module/ class functions may optionally use positional arguments for enhanced
68- execution speed.
79+ - For parameterization, use ` pytest.param ` and provide a value for the ` id `
80+ argument
81+ - If the number of parameters for a test becomes large, take the list out of the
82+ decorator and make it a module variable.
83+
84+ ## Documentation
85+
86+ - Use passive language in documentation.
87+ - The maximum line length is 80 in the documentation.
88+
0 commit comments