Skip to content

Pre commit setup - #126

Open
nezhar wants to merge 2 commits into
mainfrom
pre-commit-setup
Open

Pre commit setup#126
nezhar wants to merge 2 commits into
mainfrom
pre-commit-setup

Conversation

@nezhar

@nezhar nezhar commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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

  • Added a .pre-commit-config.yaml with several hooks (e.g., trailing whitespace, end-of-file fixer, ruff, pyupgrade, actionlint) to automate code style checks.
  • Added a GitHub Actions workflow .github/workflows/pre-commit.yml to run pre-commit checks on push and pull requests.

Code Formatting and Consistency

  • Updated function argument formatting in multiple files (e.g., 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)
  • Added or adjusted trailing commas and fixed dictionary closing braces in several files to comply with formatting standards. (F4f0b75dR1, F4f0b75dR2)

String Formatting and Error Message Improvements

  • Ensured all multi-line error and info messages use trailing commas for consistency and proper formatting, especially in user-facing error and warning messages. (F74ea2f3R1, F06f699aR2, F06f699aR3, F06f699aR4, F06f699aR5, F06f699aR6, F06f699aR7, F06f699aR8, F06f699aR9, Facfa779R2, Ff1574fdR1, Ff1574fdR2, Ff1574fdR3)

Minor Refactoring

  • Simplified some conditional logic and function calls for readability (e.g., collapsing multi-line if statements, 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

    • Added automated pre-commit checks for pushes and pull requests.
    • Standardized code, configuration, and test formatting across the project.
  • Documentation

    • Clarified Podman network and container-name resolution setup instructions.
  • Style

    • Improved formatting and readability of command-line messages and declarations without changing behavior.

nezhar added 2 commits July 30, 2026 18:19
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.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Formatting and validation updates

Layer / File(s) Summary
Pre-commit automation and documentation
.github/workflows/pre-commit.yml, .pre-commit-config.yaml, docs/configuration.md, scripts/check_default_images.py
Adds pre-commit hooks and a workflow for pushes and pull requests, updates Podman DNS guidance, and reformats a timeout message.
CLI declarations and messages
src/vibepod/cli.py, src/vibepod/commands/*
Reflows Typer annotations, function calls, and CLI messages without changing command behavior or option semantics.
Core implementation formatting
src/vibepod/compat.py, src/vibepod/constants.py, src/vibepod/core/*
Reformats signatures, validation messages, Docker errors, image defaults, engine results, and task constants while preserving logic.
Test and smoke-test formatting
tests/*
Reformats test signatures, assertions, fixtures, SQL calls, mocks, and integration diagnostics without changing test inputs or expected behaviors.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.82% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding pre-commit setup and CI hooks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pre-commit-setup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7b45600 and b656d40.

📒 Files selected for processing (32)
  • .github/workflows/pre-commit.yml
  • .pre-commit-config.yaml
  • docs/configuration.md
  • scripts/check_default_images.py
  • src/vibepod/cli.py
  • src/vibepod/commands/attach.py
  • src/vibepod/commands/config.py
  • src/vibepod/commands/doctor.py
  • src/vibepod/commands/list_cmd.py
  • src/vibepod/commands/logs.py
  • src/vibepod/commands/run.py
  • src/vibepod/commands/skills.py
  • src/vibepod/commands/task.py
  • src/vibepod/compat.py
  • src/vibepod/constants.py
  • src/vibepod/core/docker.py
  • src/vibepod/core/launch.py
  • src/vibepod/core/skills_engine.py
  • src/vibepod/core/tasks.py
  • tests/integration/test_runtime_smoke.py
  • tests/test_cli.py
  • tests/test_config.py
  • tests/test_docker.py
  • tests/test_doctor.py
  • tests/test_overlay.py
  • tests/test_proxy_permissions.py
  • tests/test_run.py
  • tests/test_session_logger.py
  • tests/test_skills.py
  • tests/test_skills_engine_driver.py
  • tests/test_task_cmd.py
  • tests/test_tasks.py
💤 Files with no reviewable changes (1)
  • docs/configuration.md

Comment on lines +12 to +13
- name: Check out repository
uses: actions/checkout@v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 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.

Suggested change
- 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant