Skip to content

Commit 915d828

Browse files
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent a8088c6 commit 915d828

File tree

2 files changed

+70
-50
lines changed

2 files changed

+70
-50
lines changed

‎.github/CONTRIBUTING.md‎

Lines changed: 64 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ Start your review with a clear, actionable recommendation:
309309
- 🔴 **Block** — Critical issues require major rework
310310

311311
**Example:**
312+
312313
```
313314
🟠 Request Changes — Missing unit tests for new `PolygonMerger` class and no documentation entry added for autogeneration.
314315
```
@@ -359,21 +360,24 @@ Provide **specific feedback using inline comments** on the changed code. Use **n
359360
**Check for:**
360361

361362
1. **Correctness**
362-
- Logic errors or edge cases not handled
363-
- Potential bugs (None checks, array bounds, division by zero)
364-
- Incorrect assumptions
363+
364+
- Logic errors or edge cases not handled
365+
- Potential bugs (None checks, array bounds, division by zero)
366+
- Incorrect assumptions
365367

366368
2. **Python Best Practices**
367-
- Non-idiomatic patterns
368-
- Improper exception handling
369-
- Inefficient implementations
370-
- Missing or incorrect type hints
369+
370+
- Non-idiomatic patterns
371+
- Improper exception handling
372+
- Inefficient implementations
373+
- Missing or incorrect type hints
371374

372375
3. **Project Conventions**
373-
- **Docstrings:** Must follow [Google-style](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods)
374-
- **Code style:** Must pass linting (`uv run pre-commit run --all-files`)
375-
- **Imports:** Standard library → third-party → local
376-
- **Naming:** Clear, descriptive, follows PEP 8
376+
377+
- **Docstrings:** Must follow [Google-style](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods)
378+
- **Code style:** Must pass linting (`uv run pre-commit run --all-files`)
379+
- **Imports:** Standard library → third-party → local
380+
- **Naming:** Clear, descriptive, follows PEP 8
377381

378382
**Place inline comments directly on problematic code**, then reference them in your summary.
379383

@@ -392,14 +396,16 @@ Use **n/5** scoring for test coverage and quality:
392396
**For New Features or Bug Fixes:**
393397
394398
1. **Coverage Requirements**
395-
- [ ] Unit tests added for new functions/classes
396-
- [ ] Edge cases covered (empty inputs, None, large arrays, boundary conditions)
397-
- [ ] Regression tests for bug fixes
399+
400+
- [ ] Unit tests added for new functions/classes
401+
- [ ] Edge cases covered (empty inputs, None, large arrays, boundary conditions)
402+
- [ ] Regression tests for bug fixes
398403
399404
2. **Test Quality**
400-
- [ ] Assertions are specific (not just "no exception raised")
401-
- [ ] Tests use realistic scenarios
402-
- [ ] Test names clearly describe what they validate
405+
406+
- [ ] Assertions are specific (not just "no exception raised")
407+
- [ ] Tests use realistic scenarios
408+
- [ ] Test names clearly describe what they validate
403409
404410
#### 3.3 Documentation Quality
405411
@@ -416,21 +422,23 @@ Use **n/5** scoring for documentation completeness:
416422
**For New Features:**
417423
418424
1. **Docstring Requirements**
419-
- [ ] Docstrings for all public functions/classes
420-
- [ ] Parameters, return values, and exceptions documented
421-
- [ ] Usage examples in docstrings
425+
426+
- [ ] Docstrings for all public functions/classes
427+
- [ ] Parameters, return values, and exceptions documented
428+
- [ ] Usage examples in docstrings
422429
423430
2. **Documentation Integration**
424-
- [ ] Entry added to appropriate docs page (e.g., `docs/detection/tools/*.md`)
425-
- [ ] Added to mkdocs navigation (`mkdocs.yml`)
426-
- [ ] Changelog entry (`docs/changelog.md`) for user-facing changes
431+
432+
- [ ] Entry added to appropriate docs page (e.g., `docs/detection/tools/*.md`)
433+
- [ ] Added to mkdocs navigation (`mkdocs.yml`)
434+
- [ ] Changelog entry (`docs/changelog.md`) for user-facing changes
427435
428436
**For Changes to Existing Features:**
429437
430438
1. **Update Requirements**
431-
- [ ] Docstrings updated to reflect changes
432-
- [ ] Deprecated features marked with warnings
433-
- [ ] Migration guide for breaking changes
439+
- [ ] Docstrings updated to reflect changes
440+
- [ ] Deprecated features marked with warnings
441+
- [ ] Migration guide for breaking changes
434442
435443
### 4. Risk Assessment
436444
@@ -445,27 +453,32 @@ Use **n/5** scoring for documentation completeness:
445453
**Risk Categories:**
446454
447455
1. **Breaking Changes**
448-
- Changes to public APIs (function signatures, return types)
449-
- Removal of deprecated features
450-
- Changed behavior in existing functionality
451-
- **If breaking:** Must include migration instructions
456+
457+
- Changes to public APIs (function signatures, return types)
458+
- Removal of deprecated features
459+
- Changed behavior in existing functionality
460+
- **If breaking:** Must include migration instructions
452461
453462
2. **Performance Impact**
454-
- Inefficient algorithms (O(n²) where O(n) possible)
455-
- Memory-intensive operations on large arrays
456-
- Potential bottlenecks in hot paths
463+
464+
- Inefficient algorithms (O(n²) where O(n) possible)
465+
- Memory-intensive operations on large arrays
466+
- Potential bottlenecks in hot paths
457467
458468
3. **Compatibility Issues**
459-
- New Python version requirements
460-
- New dependencies
461-
- Platform-specific code
469+
470+
- New Python version requirements
471+
- New dependencies
472+
- Platform-specific code
462473
463474
4. **Security Concerns**
464-
- Unvalidated user input
465-
- Potential code execution risks
466-
- Sensitive data exposure
475+
476+
- Unvalidated user input
477+
- Potential code execution risks
478+
- Sensitive data exposure
467479
468480
**Example:**
481+
469482
```
470483
Risk Level: 4/5 🟠 High Performance Risk
471484
@@ -487,19 +500,22 @@ return process(detections.mask)
487500
**Suggestion Categories:**
488501
489502
1. **Code Improvements**
490-
- Logic simplifications
491-
- Better error handling
492-
- More readable implementations
503+
504+
- Logic simplifications
505+
- Better error handling
506+
- More readable implementations
493507
494508
2. **Performance Optimizations**
495-
- NumPy vectorization opportunities
496-
- Caching expensive computations
497-
- Batch processing
509+
510+
- NumPy vectorization opportunities
511+
- Caching expensive computations
512+
- Batch processing
498513
499514
3. **Architecture Improvements**
500-
- Code reuse opportunities
501-
- Better abstractions
502-
- More maintainable designs
515+
516+
- Code reuse opportunities
517+
- Better abstractions
518+
- More maintainable designs
503519
504520
### 6. Review Summary Template
505521

‎.github/copilot-instructions.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ supervision/
3434
## 🔧 Development Commands
3535

3636
**Setup:**
37+
3738
```bash
3839
# Install dependencies
3940
uv pip install -r pyproject.toml --group dev --group docs --extra metrics
@@ -43,6 +44,7 @@ uv run pre-commit install
4344
```
4445

4546
**Quality Checks:**
47+
4648
```bash
4749
# Run all pre-commit hooks (formatting, linting, type checking)
4850
uv run pre-commit run --all-files
@@ -52,6 +54,7 @@ uv run pytest --cov=supervision
5254
```
5355

5456
**Documentation:**
57+
5558
```bash
5659
# Serve docs locally at http://127.0.0.1:8000
5760
uv run mkdocs serve
@@ -73,8 +76,8 @@ uv run mkdocs serve
7376
- **Linting**: Enforced by `ruff-check` (pre-commit)
7477
- **Type Hints**: Required on all new code
7578
- **Docstrings**: Required using [Google Python style](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods)
76-
- Must include usage examples with primitive values
77-
- Serve as runnable documentation
79+
- Must include usage examples with primitive values
80+
- Serve as runnable documentation
7881

7982
### Performance
8083

@@ -117,6 +120,7 @@ For new public functions/classes:
117120
**When reviewing PRs, follow the comprehensive [PR Review Guidelines](CONTRIBUTING.md#pr-review-guidelines).**
118121

119122
Quick checklist:
123+
120124
- Tests included and passing
121125
- Docstrings follow Google style with examples
122126
- Pre-commit hooks pass

0 commit comments

Comments
 (0)