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
Install dependencies listed in `requirements_ci.txt`:
18
-
19
-
```bash
20
-
pip install -r requirements_ci.txt
21
-
```
22
-
23
-
We recommend using a virtual environment:
24
-
25
-
```bash
26
-
python -m venv .venv
27
-
source .venv/bin/activate # On Windows: .venv\Scripts\activate
28
-
```
29
-
30
-
---
31
-
32
-
## Code Style & Formatting
33
-
34
-
This project uses:
35
-
36
-
-[`Ruff`](https://docs.astral.sh/ruff/) – for fast PEP8 linting and auto-fixing
37
-
38
-
Ruff is configured via `pyproject.toml`, so no additional config files are needed.
39
-
40
-
### Style Checks and Auto-Fixing
41
-
Two helper scripts are provided for working with code style:
42
-
43
-
#### Check style:
44
-
```bash
45
-
python autopts/style_tools.py check
46
-
```
47
-
This will run `ruff check` and log the output to `logs/pep8/ruff_check.log`.
48
-
49
-
#### Auto-fix style issues:
50
-
```bash
51
-
python autopts/style_tools.py fix
52
-
```
53
-
This will run `ruff check --fix` and apply fixes. Output is logged to `logs/pep8/ruff_fix.log`.
54
-
55
-
---
56
-
57
-
### Manual Usage
58
-
59
-
You can also run `ruff` directly:
60
-
61
-
```bash
62
-
ruff check .
63
-
ruff check . --fix
64
-
```
65
-
66
-
---
67
-
### (Optional) Pre-commit Hook
68
-
69
-
To automatically check code style before each commit:
70
-
71
-
1. Install `pre-commit`:
72
-
```bash
73
-
pip install pre-commit
74
-
pre-commit install
75
-
```
76
-
77
-
2. Now each commit will trigger `ruff` automatically:
78
-
79
-
```bash
80
-
git commit -m "Your message"
81
-
```
82
-
---
83
-
84
-
85
-
### GitHub Actions – Automatic Style Check
86
-
87
-
A workflow is configured in `.github/workflows/full-style-matrix.yml` to automatically check code style on every push or pull request to `main` or `master`.
88
-
89
-
### What it does:
90
-
- Checks code with `ruff`
91
-
92
-
This ensures consistent code quality across all contributions.
93
-
94
-
---
95
-
96
-
# Table of Contents
3
+
## Table of Contents
97
4
98
5
*[Introduction](#introduction)
99
6
*[Architecture](#architecture)
@@ -105,6 +12,7 @@ This ensures consistent code quality across all contributions.
105
12
*[Zephyr with AutoPTS step-by-step setup tutorial](#zephyr-with-autopts-step-by-step-setup-tutorial)
106
13
*[Tutorials](#tutorials)
107
14
*[More examples of run and tips](#more-examples-of-run-and-tips)
15
+
*[Code Style and Formatting](#code-style-and-formatting)
108
16
*[Slack Channel](#slack-channel)
109
17
110
18
# Introduction
@@ -408,6 +316,46 @@ Then it sends recovery request to autoptsserver, restarting and reinitializing P
408
316
409
317
Options --superguard and --ykush works on autoptsclient same as on autoptsserver. So when run with --superguard 15, after 15 minutes of unfinished test case, superguard will force recovery. With option --ykush \<port\> the IUT board will be re-plugged during recovery.
410
318
319
+
# Code Style and Formatting
320
+
321
+
This project uses [Ruff](https://docs.astral.sh/ruff/) for fast PEP8 linting and auto-fixing.
322
+
Ruff is configured via `pyproject.toml`.
323
+
324
+
Install python dependencies:
325
+
326
+
```bash
327
+
pip install -r requirements_ci.txt
328
+
```
329
+
330
+
To check the style, run:
331
+
```bash
332
+
ruff check .
333
+
```
334
+
335
+
To check and auto-fix the style, run:
336
+
337
+
```bash
338
+
ruff check . --fix
339
+
```
340
+
341
+
---
342
+
### (Optional) Pre-commit Hook
343
+
344
+
To automatically check code style before each commit, install `pre-commit`:
345
+
```bash
346
+
pip install pre-commit
347
+
pre-commit install
348
+
```
349
+
---
350
+
351
+
352
+
### GitHub Actions – Automatic Style Check
353
+
354
+
A workflow is configured in`.github/workflows/full-style-matrix.yml` to automatically check code style
355
+
on every push or pull request to main branch.
356
+
357
+
---
358
+
411
359
# Community
412
360
413
361
Use this [link](https://discord.com/invite/Ck7jw53nU2) to join Discord server. After that enter [#bt-qualification](https://discord.com/channels/720317445772017664/733036879062106264) channel (under Bluetooth section). Although Discord server is for Zephyr Project topics are not limited to Zephyr.
0 commit comments