Skip to content

Commit 530eec6

Browse files
committed
README: Update the style checker description
1 parent adde957 commit 530eec6

1 file changed

Lines changed: 42 additions & 94 deletions

File tree

README.md

Lines changed: 42 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,6 @@
11
# Getting Started
2-
Follow the steps below to set up the project, install dependencies,
3-
and enable automatic code formatting and linting.
42

5-
---
6-
7-
### Clone the Repository
8-
9-
```bash
10-
git clone https://github.com/your-username/your-repo.git
11-
cd your-repo
12-
```
13-
---
14-
15-
### 2. Install Dependencies
16-
17-
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
974

985
* [Introduction](#introduction)
996
* [Architecture](#architecture)
@@ -105,6 +12,7 @@ This ensures consistent code quality across all contributions.
10512
* [Zephyr with AutoPTS step-by-step setup tutorial](#zephyr-with-autopts-step-by-step-setup-tutorial)
10613
* [Tutorials](#tutorials)
10714
* [More examples of run and tips](#more-examples-of-run-and-tips)
15+
* [Code Style and Formatting](#code-style-and-formatting)
10816
* [Slack Channel](#slack-channel)
10917

11018
# Introduction
@@ -408,6 +316,46 @@ Then it sends recovery request to autoptsserver, restarting and reinitializing P
408316

409317
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.
410318

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+
411359
# Community
412360

413361
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

Comments
 (0)