Skip to content

Commit 1ffa2c2

Browse files
authored
feat(#147): update Python tooling to favor ruff + ty (Astral stack) (#148)
1 parent 6e26852 commit 1ffa2c2

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Every development issue MUST include these checkboxes:
5757
4. **If linting setup is missing or undocumented**, enhance project documentation
5858

5959
### **Common Linting Commands (Dynamic Discovery)**
60-
- **Python**: Check pyproject.toml, .ruff.toml → Use discovered commands or defaults: `ruff check`, `mypy`
60+
- **Python**: Check pyproject.toml, .ruff.toml → Use discovered commands or defaults: `ruff check`, `ruff format`, `ty`
6161
- **JavaScript/TypeScript**: Check package.json, .eslintrc* → Use discovered commands or defaults: `npm run lint`, `tsc`
6262
- **Rails**: Check Gemfile, .rubocop.yml → Use discovered commands or defaults: `bundle exec rubocop`
6363
- **Rust**: Check Cargo.toml → Use discovered commands or defaults: `cargo clippy`, `cargo fmt`
@@ -75,7 +75,7 @@ Every development issue MUST include these checkboxes:
7575

7676
## Code Style Guidelines
7777
- **Imports**: Sort alphabetically, group standard library/third-party/project imports
78-
- **Formatting**: Use project-configured formatters (black, prettier, rustfmt)
78+
- **Formatting**: Use project-configured formatters (ruff format, prettier, rustfmt)
7979
- **Types**: Always use precise type hints for public functions/classes
8080
- **Naming**: Use descriptive names, follow language conventions (snake_case, camelCase)
8181
- **Error handling**: Handle errors explicitly, don't ignore or suppress them

‎prompts/python-best-practices.txt‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ NEVER auto-create documentation without approval:
106106
🚨 **PR COMPLETION PROTOCOL**
107107
Your work is NOT complete when tests pass locally. Work is complete when:
108108
- ✅ Tests pass locally with 80%+ coverage
109-
- ✅ All linting passes (ruff, ty, black)
109+
- ✅ All linting passes (ruff check, ruff format, ty)
110110
- ✅ Code pushed to remote via @git-agent
111111
- ✅ CI verified passing (actual confirmation, not assumption)
112112
- ✅ PR created via @git-agent
@@ -139,7 +139,7 @@ NEVER consider work complete without PR review approval.
139139

140140
5. Type Hinting and Static Analysis
141141
• Enforce precise type hints on all public functions, classes, and module exports.
142-
• Recommend and configure linters/type checkers (ty, flake8, black, ruff).
142+
• Recommend and configure linters/type checkers (ruff for linting/formatting, ty for type checking).
143143
• **CRITICAL**: Run ALL project linting tools before creating commits.
144144

145145
6. **FORBIDDEN PRACTICES - ZERO TOLERANCE POLICY**
@@ -175,11 +175,10 @@ NEVER consider work complete without PR review approval.
175175
**FIRST: Discover project linters** - Check pyproject.toml, setup.cfg, .flake8, .pylintrc for configured tools
176176
**MANDATORY before delegating to @git-agent:**
177177
• Run the complete test suite (pytest or project-specific test command)
178-
• Execute ALL linting tools:
179-
– black (or configured formatter) for code formatting
180-
– flake8/ruff for style violations
181-
– ty for type checking
182-
– isort for import ordering
178+
• Execute ALL linting tools:
179+
– ruff check for linting and style violations
180+
– ruff format for code formatting
181+
– ty for type checking
183182
• Verify coverage meets project requirements (minimum 80% for new code)
184183
• If ANY check fails, fix issues before delegating to git agent
185184
• Document which commands were run and their results
@@ -191,7 +190,7 @@ NEVER consider work complete without PR review approval.
191190
• NEVER perform git operations directly
192191
• When code is ready for version control:
193192
1. Ensure all tests pass with required coverage (80% minimum, 95%+ critical paths)
194-
2. Run all linting and type checking tools (ruff, ty, black, isort)
193+
2. Run all linting and type checking tools (ruff check, ruff format, ty)
195194
3. Verify all quality gates passed
196195
4. Then state: "Code is ready for git operations. Use @git-agent for version control."
197196
• Focus on Python architecture and quality, delegate version control

0 commit comments

Comments
 (0)