Skip to content

Implement metadata finder for pre-commit#14222

Merged
AbhishekBhaskar merged 2 commits intomainfrom
abhishekbhaskar/add-metadata-finder-pre-commit
Feb 19, 2026
Merged

Implement metadata finder for pre-commit#14222
AbhishekBhaskar merged 2 commits intomainfrom
abhishekbhaskar/add-metadata-finder-pre-commit

Conversation

@AbhishekBhaskar
Copy link
Contributor

What are you trying to accomplish?

This PR implements the MetadataFinder class for pre-commit.

Anything you want to highlight for special attention from reviewers?

The implementation mirrors the github_actions pattern but accounts for pre_commit's URL-based naming convention

How will you know you've accomplished your goal?

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@AbhishekBhaskar AbhishekBhaskar self-assigned this Feb 19, 2026
Copilot AI review requested due to automatic review settings February 19, 2026 06:37
@AbhishekBhaskar AbhishekBhaskar requested a review from a team as a code owner February 19, 2026 06:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements the MetadataFinder class for the pre-commit ecosystem, enabling Dependabot to discover source repositories, changelogs, and release notes for pre-commit hooks.

Changes:

  • Implements MetadataFinder#look_up_source to extract source URLs from pre-commit dependencies
  • Handles both GitHub and GitLab sources
  • Supports subdependencies (dependencies with no requirements) by using the dependency name directly as the URL
  • Follows the established pattern from github_actions ecosystem

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pre_commit/lib/dependabot/pre_commit/metadata_finder.rb Implements MetadataFinder class with look_up_source method that extracts URLs from dependency requirements or uses dependency name for subdependencies
pre_commit/spec/dependabot/pre_commit/metadata_finder_spec.rb Adds comprehensive test coverage for GitHub sources, GitLab sources, and subdependencies with no requirements

@AbhishekBhaskar AbhishekBhaskar force-pushed the abhishekbhaskar/add-metadata-finder-pre-commit branch from 5f24258 to f1af9a0 Compare February 19, 2026 18:51
@AbhishekBhaskar AbhishekBhaskar merged commit 3329651 into main Feb 19, 2026
83 checks passed
@AbhishekBhaskar AbhishekBhaskar deleted the abhishekbhaskar/add-metadata-finder-pre-commit branch February 19, 2026 19:30
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.

3 participants

Comments