Skip to content

Commit a0990e3

Browse files
committed
Added user guide
1 parent c49b4c4 commit a0990e3

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Collecting Metrics
2+
==================
3+
4+
PTB allows you to collect various metrics on the quality of your project
5+
regarding Coverage, Security, and Static Code Analysis.
6+
7+
For each metric there is a dedicated nox task, generating one or multiple
8+
files and based on a a selected external python tool.
9+
10+
+-----------------------------+-----------------------------+--------------+
11+
| Nox Task | Generated Files | Based on |
12+
+=============================+=============================+==============+
13+
| ``lint:code`` | ``lint.txt``, ``lint.json`` | ``pylint`` |
14+
+-----------------------------+-----------------------------+--------------+
15+
| ``lint:security`` | ``.security.json`` | ``bandit`` |
16+
+-----------------------------+-----------------------------+--------------+
17+
| ``test:unit -- --coverage`` | ``.coverage`` | ``coverage`` |
18+
+-----------------------------+-----------------------------+--------------+
19+
20+
The metrics are computed for each point in your build matrix, e.g. for each
21+
Python version defined in file ``noxconfig.py``:
22+
23+
.. code-block:: python
24+
25+
@dataclass(frozen=True)
26+
class Config:
27+
python_versions = ["3.9", "3.10", "3.11", "3.12", "3.13"]
28+
29+
The GitHub workflows of your project can
30+
31+
* Use a build matrix, e.g. using different python versions as shown above
32+
* Define multiple test sessions, e.g. for distinguishing fast vs. slow or expensive tests.
33+
34+
PTB combines the coverage data of all test sessions but using only the python
35+
version named first in attribute ``python_versions`` of class ``Config``.

doc/user_guide/user_guide.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
customization
1313
migrating
1414
how_to_release
15+
collecting_metrics

0 commit comments

Comments
 (0)