Skip to content

Commit 921eb15

Browse files
authored
Add Black and Isort for Code Formatting (#2133)
1 parent d0b5500 commit 921eb15

File tree

227 files changed

+14770
-15981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+14770
-15981
lines changed

.semaphore/semaphore.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ blocks:
193193
prologue:
194194
commands:
195195
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
196+
- sudo apt-get update -qq && sudo apt-get install -y -qq clang-format
196197
jobs:
197198
- name: Build and Tests with 'classic' group protocol
198199
commands:

CONTRIBUTOR.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ We use automated tools to maintain consistent code style:
4545

4646
```bash
4747
# Install formatting tools
48-
pip install flake8
48+
pip install black isort flake8
4949

5050
# Check style
51-
flake8 src/ tests/
51+
make style-check
52+
53+
# Fix style automatically
54+
make style-fix
5255
```
5356

57+
**Tools used:**
58+
- `black`: Automatic code formatter
59+
- `isort`: Import statement organizer
60+
- `flake8`: Code linter for style and quality checks
61+
5462
### Naming Conventions
5563

5664
- **Functions and Variables**: `snake_case`

DEVELOPER.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,40 @@ pytest -q tests/integration
181181
182182
See [tests/README.md](tests/README.md) for instructions on how to run tests.
183183
184-
## Linting & formatting (suggested)
184+
## Linting & formatting
185185
186-
- Python: `black .` and `flake8` (or `ruff`) per project configuration
187-
- Markdown: `markdownlint '**/*.md'`
186+
We use automated tools to maintain consistent code style:
187+
188+
- **black**: Code formatter
189+
- **isort**: Import sorter
190+
- **flake8**: Linter for code quality
191+
192+
### Running formatting checks
193+
194+
```bash
195+
# Check formatting
196+
make style-check
197+
198+
# Fix formatting
199+
make style-fix
200+
201+
# Check only changed files
202+
make style-check-changed
203+
make style-fix-changed
204+
```
205+
206+
### Using tox
207+
208+
```bash
209+
# Check formatting
210+
tox -e black,isort
211+
212+
# Check linting
213+
tox -e flake8
214+
215+
# Run all formatting and linting checks
216+
tox -e black,isort,flake8
217+
```
188218
189219
## Documentation build
190220

0 commit comments

Comments
 (0)