Skip to content

chore: add pre-commit#59

Merged
DeepSpace2 merged 3 commits into
masterfrom
chore-add-pre-commit
Jul 7, 2026
Merged

chore: add pre-commit#59
DeepSpace2 merged 3 commits into
masterfrom
chore-add-pre-commit

Conversation

@DeepSpace2

@DeepSpace2 DeepSpace2 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores
    • Added automated pre-commit checks to PR builds, including formatting and Go linting.
    • Updated PR build triggers so changes to pre-commit configuration files are included in validation.
    • Minor cleanup across build and docs files, with no user-facing behavior changes.

Comment thread .github/workflows/pr-build.yml Fixed
Comment thread .github/workflows/reusable-pre-commit.yml Fixed
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@DeepSpace2, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ab444ab2-f3fa-4c46-ae88-c16c448f5022

📥 Commits

Reviewing files that changed from the base of the PR and between 38cb036 and 0648e04.

📒 Files selected for processing (2)
  • .github/workflows/pr-build.yml
  • .github/workflows/reusable-pre-commit.yml
📝 Walkthrough

Walkthrough

This PR introduces a pre-commit CI pipeline: a new .pre-commit-config.yaml configures pre-commit-hooks and golangci-lint, a new reusable workflow runs pre-commit against changed refs, and pr-build.yml is updated to trigger this job. Remaining changes are whitespace-only formatting fixes across docs, workflows, Dockerfile, and JS files.

Changes

Pre-commit CI Integration

Layer / File(s) Summary
Pre-commit hook configuration
.pre-commit-config.yaml
Defines pinned pre-commit-hooks (trailing-whitespace, end-of-file-fixer) and golangci-lint repos/hooks.
Reusable pre-commit workflow
.github/workflows/reusable-pre-commit.yml
New workflow_call workflow accepting base_sha/head_sha, checking out full history, setting up Python, and running pre-commit/action scoped to the ref range.
PR build wiring
.github/workflows/pr-build.yml
Extends path filters to cover the new workflow/config files and adds a pre-commit job that calls the reusable workflow with PR base/head SHAs.

Whitespace and Formatting Cleanup

Layer / File(s) Summary
Trailing whitespace/formatting fixes
.github/workflows/reusable-docker-build.yml, Dockerfile, README.md, docs/css/theme.css, docs/index.md, docs/js/anchor-jump-highlight.js, docs/js/copy-to-clipboard.js, docs/monitoring.md, docs/theme/overrides/main.html
Removes trailing whitespace, blank lines, and adjusts line wrapping with no functional or content changes.

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

Sequence Diagram(s)

sequenceDiagram
  participant GitHubPR as Pull Request
  participant PrBuild as pr-build.yml
  participant Changes as changes job
  participant PreCommitJob as pre-commit job
  participant ReusableWorkflow as reusable-pre-commit.yml

  GitHubPR->>PrBuild: trigger on file changes
  PrBuild->>Changes: run dorny/paths-filter
  Changes-->>PrBuild: src output true/false
  PrBuild->>PreCommitJob: run if src == true
  PreCommitJob->>ReusableWorkflow: call with base_sha, head_sha
  ReusableWorkflow->>ReusableWorkflow: checkout, setup Python, run pre-commit/action
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title matches the main change: adding pre-commit configuration and workflow support.

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.

🧹 Nitpick comments (1)
.pre-commit-config.yaml (1)

1-11: 📐 Maintainability & Code Quality | 🔵 Trivial

Consider adding a few more low-cost hygiene hooks.

check-yaml, check-added-large-files, and check-merge-conflict from the same pre-commit-hooks repo are commonly paired with trailing-whitespace/end-of-file-fixer and would help validate the very YAML workflow files this PR introduces.

🤖 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 @.pre-commit-config.yaml around lines 1 - 11, Add the suggested hygiene hooks
to the existing pre-commit-hooks entry in the pre-commit configuration so the
repo also runs check-yaml, check-added-large-files, and check-merge-conflict
alongside trailing-whitespace and end-of-file-fixer. Update the pre-commit
config near the current hooks list to include these additional hook IDs from the
same pre-commit-hooks repository, keeping the golangci-lint repo unchanged.
🤖 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.

Nitpick comments:
In @.pre-commit-config.yaml:
- Around line 1-11: Add the suggested hygiene hooks to the existing
pre-commit-hooks entry in the pre-commit configuration so the repo also runs
check-yaml, check-added-large-files, and check-merge-conflict alongside
trailing-whitespace and end-of-file-fixer. Update the pre-commit config near the
current hooks list to include these additional hook IDs from the same
pre-commit-hooks repository, keeping the golangci-lint repo unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4aa9cf1c-5392-426c-9ff9-e1276fc0ac35

📥 Commits

Reviewing files that changed from the base of the PR and between 915c68e and 38cb036.

⛔ Files ignored due to path filters (4)
  • docs/assets/logo_full.svg is excluded by !**/*.svg
  • docs/assets/logo_full_dark.svg is excluded by !**/*.svg
  • docs/assets/logo_full_light.svg is excluded by !**/*.svg
  • docs/assets/logo_icon.svg is excluded by !**/*.svg
📒 Files selected for processing (12)
  • .github/workflows/pr-build.yml
  • .github/workflows/reusable-docker-build.yml
  • .github/workflows/reusable-pre-commit.yml
  • .pre-commit-config.yaml
  • Dockerfile
  • README.md
  • docs/css/theme.css
  • docs/index.md
  • docs/js/anchor-jump-highlight.js
  • docs/js/copy-to-clipboard.js
  • docs/monitoring.md
  • docs/theme/overrides/main.html
💤 Files with no reviewable changes (2)
  • Dockerfile
  • docs/css/theme.css

DeepSpace2 and others added 2 commits July 7, 2026 23:22
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@DeepSpace2 DeepSpace2 force-pushed the chore-add-pre-commit branch from 04edb0c to 0648e04 Compare July 7, 2026 20:27
@DeepSpace2 DeepSpace2 merged commit de2b8e9 into master Jul 7, 2026
9 checks passed
@DeepSpace2 DeepSpace2 deleted the chore-add-pre-commit branch July 7, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants