feat(opinionated-setup): production-tested improvements#5
Conversation
Code Review: PR #5 - Production-tested Python Setup ImprovementsSummaryThis PR enhances the ✅ Strengths1. Modern Dependency Management (PEP 735)The migration from
2. Enhanced Linting RulesThe expanded ruff configuration adds valuable linting:
3. Better Type Checking
4. Improved Pre-commit Configuration
5. Documentation Quality
🔍 Areas for Consideration1. Ruff Linting StrictnessLocation: opinionated-setup/skills/setup-python-project/SKILL.md:75-93 The expanded ruff rules are comprehensive but may be strict for some projects:
Recommendation: Consider documenting in the skill that users can adjust these rules based on their project type. Perhaps add a comment like: # Adjust these rules based on project needs:
# - Remove ANN for less strict type annotation requirements
# - Remove T201 if building a CLI tool where prints are intentional2. S101 Ignore ScopeLocation: opinionated-setup/skills/setup-python-project/SKILL.md:92 The comment says "Allow assert in tests" but the ignore is global, not scoped to test files. Recommendation: Consider using ruff's per-file-ignores: [tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101"]This would only allow asserts in test files, catching inappropriate asserts in production code. 3. Pre-commit Hook Version CheckingLocation: opinionated-setup/skills/setup-python-project/SKILL.md:118 The VERSION NOTE is helpful, but the execution instructions (step 2, line 408) don't provide clear guidance on HOW to check for latest versions. Recommendation: Consider adding specific instructions: 2. **Check for latest versions** of pre-commit hook repos:
- Visit https://github.com/astral-sh/uv-pre-commit/releases
- Visit https://github.com/astral-sh/ruff-pre-commit/releases
- Visit https://github.com/pre-commit/pre-commit-hooks/releases
- Visit https://github.com/adrienverge/yamllint/releases
- Visit https://github.com/codespell-project/codespell/releases
- Update the rev: values in the template below with the latest tags4. Missing Test File UpdatesThe PR doesn't include a test file example with the new linting rules. Recommendation: Consider updating the 5. Backwards Compatibility NoteProjects using this skill before the changes would have Recommendation: Consider adding a note in the SKILL.md about migrating existing projects, or clarifying that this skill is for new projects only. 🐛 Potential IssuesNone FoundNo bugs or security concerns identified. The changes are well-considered and safe. ⚡ Performance Considerations
🔒 Security Review
🧪 Test CoverageObservation: This PR modifies a documentation/template file (SKILL.md). There are no executable tests for skills in this repository. Recommendation: Consider whether skill templates should have integration tests that verify generated projects work correctly. This could be a future enhancement, not blocking for this PR. 📝 Documentation Quality
Final VerdictOverall Assessment: ✅ APPROVED This is a high-quality PR that brings production-tested improvements to the Python project setup skill. The changes are:
Recommendations Summary
Suggested Merge Strategy✅ Ready to merge with optional consideration of the recommendations above. None of the suggestions are blocking - they're enhancements that could be addressed in follow-up PRs if desired. Great work incorporating real-world learnings into the skill templates! 🎉 |
Feedback Source
Skill:
opinionated-setup:setup-python-projectSummary
Improvements based on comparison with a real-world production Python project (.wlrenv),
incorporating patterns that proved useful in practice.
Changes Made
pyproject.toml Template
Use
[dependency-groups](PEP 735) instead of[project.optional-dependencies]uv sync --group devExpanded ruff lint rules - Added comprehensive linting:
N(pep8-naming)S(bandit security) withS101ignored for testsANN(annotations)ASYNC(async linting)UP(pyupgrade)T201(print statements)mypy
enable_error_code- Addedtruthy-boolto catch async mistakes likeif f.exists()instead ofif await f.exists()pyright
reportImplicitOverride- Catches missing@overridedecorators.pre-commit-config.yaml Template
Added
uv-lockhook - Keeps lockfile in sync viaastral-sh/uv-pre-commitAdded VERSION NOTE - Reminds to check for latest versions of all hook repos
Enhanced config structure:
default_install_hook_types: [pre-commit, post-checkout]default_stages: [pre-commit, pre-push, manual]ci:section withautoupdate_schedule: monthlyImproved pre-commit-hooks:
.mdand.patchfiles on whitespace hookscheck-case-conflict,check-executables-have-shebangs,mixed-line-endingOther Changes
install-hooks.shfor better terminal compatibilityGenerated by skill-feedback:reporting-feedback