fix: preserve workspace gitignore entries - #53
Conversation
Signed-off-by: Morax <james20081204@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe workspace gitignore writer preserves existing entries and appends only missing managed patterns. Initialization and update tests cover normal, forced, empty, CRLF, and repeated operations. ChangesWorkspace gitignore preservation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pythonlings/core/curriculum.py`:
- Around line 74-77: Update the `.gitignore` append logic around
`gitignore.open` to detect the existing file’s line-ending convention and use it
consistently for the separator and all `missing_lines`; preserve CRLF files as
CRLF and retain the current behavior for files without an existing convention.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1c181795-5823-4d49-b45c-919ae305b1b8
📒 Files selected for processing (3)
pythonlings/core/curriculum.pytests/integration/test_cli_workspace.pytests/unit/test_curriculum.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (8)
pythonlings/core/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Core exercise loading, workspace setup, state, reset, solutions, and runner logic must live in
pythonlings/core/directoryKeep UI behavior in
screens/andwidgets/modules; keep behavior logic incore/modules—do not import UI in core
Files:
pythonlings/core/curriculum.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use Python 3.11+ idioms in all Python code
Use 4-space indentation in all Python code
Prefer small, typed functions where practical in Python code
**/*.py: Guard newer-stdlib usage withrequires-python = ">=3.9"and use fallbacks (e.g.tomllibfalls back totomli) in modules likecore/manifest.py
Includefrom __future__ import annotationsat the top of Python modules
Files:
pythonlings/core/curriculum.pytests/integration/test_cli_workspace.pytests/unit/test_curriculum.py
pythonlings/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Keep UI behavior in
screens/orwidgets/directories; keep filesystem, manifest, reset, and runner behavior incore/
Files:
pythonlings/core/curriculum.py
tests/integration/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Keep integration tests in
tests/integration/directory
Files:
tests/integration/test_cli_workspace.py
tests/**/*test_*.py
📄 CodeRabbit inference engine (AGENTS.md)
Name test files as
test_<behavior>.py
Files:
tests/integration/test_cli_workspace.pytests/unit/test_curriculum.py
tests/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
tests/**/*.py: Name test functions astest_<expected_behavior>
Use pytest for all tests with pytest-asyncio in auto mode for async tests
Files:
tests/integration/test_cli_workspace.pytests/unit/test_curriculum.py
**/test_*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Name tests as
test_<behavior>.pyortest_<expected_behavior>(e.g.,test_runner.py,test_state.py)
Files:
tests/integration/test_cli_workspace.pytests/unit/test_curriculum.py
tests/unit/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Keep unit tests in
tests/unit/directory
Files:
tests/unit/test_curriculum.py
🔇 Additional comments (2)
tests/integration/test_cli_workspace.py (1)
15-20: LGTM!Also applies to: 48-62, 90-104
tests/unit/test_curriculum.py (1)
46-76: LGTM!Also applies to: 90-103
Summary
.gitignorecontent during force-init and updateCloses #43
Tests
python -m pytest -q(Python 3.11: 150 passed)python -m pytest tests/unit/test_curriculum.py tests/integration/test_cli_workspace.py -q(Python 3.13: 13 passed)Screenshots
Not applicable; this changes filesystem behavior without changing CLI output.
Checklist
python -m pytest -qSummary by CodeRabbit
Bug Fixes
.gitignoreentries..gitignorefiles.Tests
.gitignorefiles.