Skip to content
/ utils Public

Download prek config when default is specified#536

Merged
5ouma merged 1 commit intomainfrom
chore-pre-commit-download-config
Nov 26, 2025
Merged

Download prek config when default is specified#536
5ouma merged 1 commit intomainfrom
chore-pre-commit-download-config

Conversation

@5ouma
Copy link
Owner

@5ouma 5ouma commented Nov 26, 2025

If a custom config is specified, avoid downloading the config file.

If custom config is specified, avoid downloading config file.
@github-actions github-actions bot added the 🚸 pre-commit Check the code with pre-commit hooks label Nov 26, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

The pre-commit/action.yml file was modified to strengthen the conditional guard for downloading pre-commit hooks. The updated condition now requires both the input config path to match the default .pre-commit-config.yaml and the hash to be empty, rather than only checking the hash.

Changes

Cohort / File(s) Summary
GitHub Actions workflow conditional tightening
pre-commit/action.yml
Modified conditional logic for pre-commit hook download to add path equality check alongside existing hash validation

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Specific focus areas:
    • Verify the path equality check correctly targets the default .pre-commit-config.yaml string
    • Confirm the logical AND combination properly handles both conditions
    • Assess whether this change addresses the intended security or behavioral goal without breaking existing workflows

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change - tightening the download condition to require the default config path.
Description check ✅ Passed The description is related to the changeset, explaining the intent to avoid downloading when a custom config is specified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-pre-commit-download-config

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7b9949 and f92f9c1.

📒 Files selected for processing (1)
  • pre-commit/action.yml (1 hunks)
🔇 Additional comments (1)
pre-commit/action.yml (1)

30-30: Correctly guards download to default config only.

The added check inputs.config == '.pre-commit-config.yaml' prevents download when a custom config path is specified, aligning with the PR objective. Combined with the existing hashFiles() check, the step now only executes when using the default config and the file doesn't exist. The downstream cleanup step (line 54–59) correctly depends on the download output, so there's no dangling cleanup if the download doesn't run.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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 and usage tips.

@5ouma 5ouma merged commit 4c57314 into main Nov 26, 2025
5 checks passed
@5ouma 5ouma deleted the chore-pre-commit-download-config branch November 26, 2025 13:29
@5ouma 5ouma changed the title Download config when default is specified Download prek config when default is specified Nov 26, 2025
@5ouma 5ouma bot mentioned this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚸 pre-commit Check the code with pre-commit hooks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant