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
feat: enforce strict code quality with expanded linting and type checking (v0.14.0)
## Summary
- Expand Ruff linting rules (B, UP, SIM, RUF, C4, PIE, PT, ASYNC, S,
T20) and add mypy type checking with Pydantic plugin across all 134
source files
- Fix all 72 ruff lint violations across 36 files and all 267 mypy type
errors across 39 files
- Add mypy pre-commit hook (local, using `uv run mypy`) and CI
type-check job
## Test plan
- [x] `uvx ruff check src/ tests/` — All checks passed
- [x] `uvx ruff format --check src/ tests/` — 266 files already
formatted
- [x] `uv run mypy src/mcpbr/` — Success: no issues found in 134 source
files
- [x] `uv run pytest -m "not integration"` — 4293 passed, 0 failures
- [x] All pre-commit hooks pass (sync-version, ruff, ruff-format, mypy,
trailing-whitespace, end-of-file-fixer, check-yaml,
check-added-large-files, check-merge-conflict)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
# Release Notes: Version 0.14.0
* **New Features**
* Added comprehensive type checking with mypy integration in
CI/pre-commit workflows
* Expanded code quality enforcement with stricter linting rules
* **Bug Fixes**
* Fixed multiple code quality violations and type errors across the
codebase
* Improved error handling and timezone handling consistency
* Enhanced validation and safety checks throughout infrastructure
providers
* **Documentation**
* Updated development guidelines to include type checking requirements
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
If any type errors remain, they MUST be fixed before proceeding.
188
+
189
+
### 3. Run Tests
179
190
180
191
```bash
181
192
# Run all non-integration tests
@@ -187,7 +198,7 @@ uv run pytest -m integration
187
198
188
199
**Expected result:** All tests must pass with 0 failures.
189
200
190
-
### 3. Update CHANGELOG
201
+
### 4. Update CHANGELOG
191
202
192
203
**MANDATORY:** If your changes are user-visible, update CHANGELOG.md:
193
204
@@ -201,7 +212,7 @@ uv run pytest -m integration
201
212
cat CHANGELOG.md | head -30
202
213
```
203
214
204
-
### 4. Verify Changes
215
+
### 5. Verify Changes
205
216
206
217
- Review all modified files
207
218
- Ensure no unintended changes were introduced
@@ -217,7 +228,8 @@ The project uses Ruff for linting with the following configuration:
217
228
218
229
-**Line length:** 100 characters (E501 is ignored)
219
230
-**Target Python version:** 3.11+
220
-
-**Enabled rules:** E (pycodestyle errors), F (pyflakes), I (isort), N (pep8-naming), W (pycodestyle warnings)
231
+
-**Enabled rules:** E (pycodestyle), F (pyflakes), I (isort), N (pep8-naming), W (warnings), B (bugbear), UP (pyupgrade), SIM (simplify), RUF (ruff-specific), C4 (comprehensions), PIE (misc), PT (pytest-style), ASYNC (async bugs), S (security/bandit), T20 (print detection)
232
+
-**Type checking:** mypy with Pydantic plugin, strict mode on core modules
221
233
222
234
### Common Linting Issues to Avoid
223
235
@@ -226,6 +238,10 @@ The project uses Ruff for linting with the following configuration:
226
238
3.**Undefined names** - All variables and functions must be defined before use
227
239
4.**Line too long** - While E501 is ignored, try to keep lines under 100 chars when reasonable
228
240
5.**Trailing whitespace** - Remove trailing whitespace from all lines
241
+
6.**Mutable default args** (B006) - Don't use `[]` or `{}` as default arguments
242
+
7.**Exception chaining** (B904) - Use `raise X from err` inside `except` blocks
gh pr create --title "feat: add my new feature" --body "Implements #123"
603
624
```
@@ -615,9 +636,10 @@ The project uses GitHub Actions for CI/CD. All PRs must pass:
615
636
616
637
1.**Lint Check** - `uvx ruff check src/ tests/`
617
638
2.**Format Check** - `uvx ruff format --check src/ tests/`
618
-
3.**Build Check** - Package builds successfully
619
-
4.**Test (Python 3.11)** - All tests pass on Python 3.11
620
-
5.**Test (Python 3.12)** - All tests pass on Python 3.12
639
+
3.**Type Check** - `mypy src/mcpbr/`
640
+
4.**Build Check** - Package builds successfully
641
+
5.**Test (Python 3.11)** - All tests pass on Python 3.11
642
+
6.**Test (Python 3.12)** - All tests pass on Python 3.12
621
643
622
644
You can view check results on any PR:
623
645
```bash
@@ -626,11 +648,11 @@ gh pr checks <PR_NUMBER>
626
648
627
649
## Summary
628
650
629
-
**Remember:** The most important rule is to run linting, formatting, and tests BEFORE committing. This ensures high code quality and prevents CI/CD failures.
651
+
**Remember:** The most important rule is to run linting, formatting, type checking, and tests BEFORE committing. This ensures high code quality and prevents CI/CD failures.
630
652
631
653
**Pre-commit command:**
632
654
```bash
633
-
uvx ruff check --fix src/ tests/ && uvx ruff format src/ tests/ && uv run pytest -m "not integration"
655
+
uvx ruff check --fix src/ tests/ && uvx ruff format src/ tests/ && uv run mypy src/mcpbr/ && uv run pytest -m "not integration"
0 commit comments