You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing_guide.rst
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,16 @@ How to Contribute Code
4
4
This document describes how the BO4E Python implementation is written and what to watch out for.
5
5
6
6
Technical Setup in your IDE
7
-
===========================
7
+
---------------------------
8
8
9
9
We're using tox. Please follow the instructions in our `Python Template Repository <https://github.com/Hochfrequenz/python_template_repository#how-to-use-this-repository-on-your-machine>`_. Feel free to open an issue if you run into any kind of problems.
10
10
11
11
Coding Style and Guidelines
12
-
===========================
12
+
---------------------------
13
+
13
14
14
15
General Rules
15
-
-------------
16
+
^^^^^^^^^^^^^
16
17
17
18
- We use (and enforce in the CI):
18
19
- black for formatting
@@ -29,7 +30,7 @@ General Rules
29
30
- We use ``snake_case`` internally but serialize as ``camelCase`` by overriding the ``data_key`` property of the schema fields.
30
31
31
32
How to Define an ENUM?
32
-
----------------------
33
+
^^^^^^^^^^^^^^^^^^^^^^
33
34
34
35
All Enums inherit from ``bo4e.enum.StrEnum``. The latter is just a usual Enum with a ``str`` mixin (see `the official docs <https://docs.python.org/3/library/enum.html?highlight=strenum#others>`_ for details). This allows us to precisely define how an enum value will be serialized. All enum values have UPPER_CASE names.
35
36
@@ -54,7 +55,7 @@ All Enums inherit from ``bo4e.enum.StrEnum``. The latter is just a usual Enum wi
54
55
# this typically happens for annoying enum values that contains "-" or start with digits
55
56
56
57
How to Define COMs or BOs
57
-
-------------------------
58
+
^^^^^^^^^^^^^^^^^^^^^^^^^
58
59
59
60
All COMponents inherit from ``bo4e.com.com.COM``. All Business Objects inherit from ``bo4e.bo.geschaeftsobjekt.Geschaeftsobjekt``.
60
61
@@ -100,7 +101,7 @@ For data validation and de/serialization we use `pydantic <https://pydantic-docs
100
101
# You don't need to be a perfect programmer to contribute to bo4e :)
101
102
102
103
Unittests
103
-
---------
104
+
^^^^^^^^^
104
105
105
106
Ideally provide unittests that show:
106
107
@@ -114,12 +115,12 @@ Ideally provide unittests that show:
114
115
Therefore, copy one of the existing "roundtrip" tests, see f.e. ``TestTarifeinschraenkung``.
115
116
116
117
Pull Request
117
-
============
118
+
------------
118
119
119
120
Open a Pull Request against the main/default branch of this repository. We'd appreciate if you allowed maintainer edits.
120
121
121
122
Release Workflow
122
-
================
123
+
----------------
123
124
124
125
- Check with tox all tests and linting: ``tox``
125
126
- Check with tox if the packaging works fine: ``tox -e test_packaging``
0 commit comments