Skip to content

Implement a get_minimum_pre_commit_version function#1165

Merged
nathanjmcdougall merged 1 commit intomainfrom
1164-a-get_minimum_supported_pre_commit_version-function
Nov 22, 2025
Merged

Implement a get_minimum_pre_commit_version function#1165
nathanjmcdougall merged 1 commit intomainfrom
1164-a-get_minimum_supported_pre_commit_version-function

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

@nathanjmcdougall nathanjmcdougall linked an issue Nov 22, 2025 that may be closed by this pull request
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 22, 2025

CodSpeed Performance Report

Merging #1165 will not alter performance

Comparing 1164-a-get_minimum_supported_pre_commit_version-function (d7a5418) with main (7b53c75)

Summary

✅ 2 untouched

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
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 a get_minimum_pre_commit_version() function that reads the minimum pre-commit version from .pre-commit-config.yaml. The function returns the version as a string (e.g., "4.4.0") or None if the file doesn't exist or the version isn't specified.

Key Changes

  • Adds get_minimum_pre_commit_version() function in src/usethis/_integrations/pre_commit/version.py
  • Includes comprehensive test coverage for happy path, missing config, and missing version declaration scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/usethis/_integrations/pre_commit/version.py Implements the core function to retrieve minimum pre-commit version from config
tests/usethis/_integrations/pre_commit/test_version.py Adds test coverage for all code paths including edge cases

@nathanjmcdougall nathanjmcdougall merged commit 2547dd8 into main Nov 22, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1164-a-get_minimum_supported_pre_commit_version-function branch November 22, 2025 09:44
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.

A get_minimum_supported_pre_commit_version function

2 participants