Pre commit setup - #126
Conversation
Hook set mirrors the anexia/django-generic-contact layout: base hooks, pyupgrade --py310-plus, add-trailing-comma, ruff check --fix and ruff format. Reformat codebase accordingly.
📝 WalkthroughWalkthroughThe pull request adds pre-commit automation and reformats documentation, CLI modules, core modules, and tests. Application control flow, option semantics, validation rules, and expected test behavior are preserved, except for smoke-test diagnostic argument formatting. ChangesFormatting and validation updates
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 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 @.github/workflows/pre-commit.yml:
- Around line 12-13: Update the checkout step using actions/checkout@v4 to
disable credential persistence with persist-credentials: false, and configure
the workflow permissions so contents access is read-only. Keep the existing
checkout behavior unchanged otherwise.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f98fd91f-693b-450f-85c5-7a251e5b3132
📒 Files selected for processing (32)
.github/workflows/pre-commit.yml.pre-commit-config.yamldocs/configuration.mdscripts/check_default_images.pysrc/vibepod/cli.pysrc/vibepod/commands/attach.pysrc/vibepod/commands/config.pysrc/vibepod/commands/doctor.pysrc/vibepod/commands/list_cmd.pysrc/vibepod/commands/logs.pysrc/vibepod/commands/run.pysrc/vibepod/commands/skills.pysrc/vibepod/commands/task.pysrc/vibepod/compat.pysrc/vibepod/constants.pysrc/vibepod/core/docker.pysrc/vibepod/core/launch.pysrc/vibepod/core/skills_engine.pysrc/vibepod/core/tasks.pytests/integration/test_runtime_smoke.pytests/test_cli.pytests/test_config.pytests/test_docker.pytests/test_doctor.pytests/test_overlay.pytests/test_proxy_permissions.pytests/test_run.pytests/test_session_logger.pytests/test_skills.pytests/test_skills_engine_driver.pytests/test_task_cmd.pytests/test_tasks.py
💤 Files with no reviewable changes (1)
- docs/configuration.md
| - name: Check out repository | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Do not persist the checkout token into the workspace.
actions/checkout keeps GITHUB_TOKEN in local Git config by default. The following pre-commit action executes hook code, so compromised hook code could read and exfiltrate that token. Set persist-credentials: false and restrict workflow permissions to read-only contents.
🔒 Proposed fix
- name: Check out repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false |
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 12-13: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for 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.
In @.github/workflows/pre-commit.yml around lines 12 - 13, Update the checkout
step using actions/checkout@v4 to disable credential persistence with
persist-credentials: false, and configure the workflow permissions so contents
access is read-only. Keep the existing checkout behavior unchanged otherwise.
Source: Linters/SAST tools
This pull request introduces pre-commit hooks and makes a large number of code style and formatting improvements across the codebase. The main goals are to enforce consistent code formatting, simplify argument lists, and improve maintainability. No functional changes are introduced—these are all non-breaking formatting and linting updates.
The most important changes include:
Pre-commit Integration
.pre-commit-config.yamlwith several hooks (e.g., trailing whitespace, end-of-file fixer, ruff, pyupgrade, actionlint) to automate code style checks..github/workflows/pre-commit.ymlto run pre-commit checks on push and pull requests.Code Formatting and Consistency
src/vibepod/cli.py,src/vibepod/commands/config.py,src/vibepod/commands/run.py,src/vibepod/commands/skills.py) to place each argument on its own line for clarity and consistency. (F5f8be28R1, Facfa779R1, F06f699aR1, F890bd80R1)String Formatting and Error Message Improvements
Minor Refactoring
ifstatements, argument lists). (F06f699aR10, F969e939R1, Fdf8f5e7R1)These changes collectively enforce a consistent code style and set up automated checks to maintain it going forward.
Summary by CodeRabbit
Chores
Documentation
Style