-
Notifications
You must be signed in to change notification settings - Fork 3
feat: create script to update versions automatically #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 94.39% 94.44% +0.05%
==========================================
Files 3 4 +1
Lines 107 108 +1
==========================================
+ Hits 101 102 +1
Misses 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 introduces an automated system for updating clang-format and clang-tidy versions from PyPI. The implementation extracts version constants into a dedicated module and adds a Python script with GitHub Actions workflow to periodically fetch and update these versions.
Key changes:
- Created a dedicated
versions.py
module containing version constants for clang-format and clang-tidy - Added an automation script that fetches latest versions from PyPI and updates the versions file
- Configured a GitHub Actions workflow to run the update script weekly and create PRs with version updates
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
cpp_linter_hooks/versions.py | New module containing extracted version constants with automation-ready structure |
scripts/update_versions.py | Script that fetches versions from PyPI and updates the versions.py file programmatically |
cpp_linter_hooks/util.py | Refactored to import version constants from the new versions module instead of defining them inline |
tests/test_util.py | Updated imports to reference version constants from the new versions module |
.github/workflows/update-versions.yml | GitHub Actions workflow for automated weekly version updates via pull requests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
scripts/update_versions.py
Outdated
stable_versions = [ | ||
v | ||
for v in versions | ||
if not any(char in v for char in ["a", "b", "rc", "dev"]) |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pre-release filtering logic is flawed. Checking if single characters 'a' or 'b' exist in version strings will incorrectly filter out valid stable versions. For example, version '18.1.8' contains 'a' and would be excluded. Use regex pattern matching or check for specific pre-release patterns like 'alpha', 'beta', 'rc', 'dev' instead.
stable_versions = [ | |
v | |
for v in versions | |
if not any(char in v for char in ["a", "b", "rc", "dev"]) | |
# Exclude pre-releases: versions with 'aN', 'bN', 'rcN', or '.devN' suffixes | |
pre_release_pattern = re.compile(r"(a|b|rc|\.dev)\d+", re.IGNORECASE) | |
stable_versions = [ | |
v | |
for v in versions | |
if not pre_release_pattern.search(v) |
Copilot uses AI. Check for mistakes.
CodSpeed Performance ReportMerging #132 will not alter performanceComparing Summary
Footnotes
|
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThis PR implements automated version management for clang-format and clang-tidy tools. It creates a centralized versions module, a PyPI-based version fetcher script, and a GitHub Actions workflow that periodically updates version lists from PyPI. Existing imports are refactored to use the new centralized versions module. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes The changes span multiple components (CI workflow, new script with API/file I/O logic, module refactoring), but are cohesively scoped to version automation with clear separation of concerns. The PyPI API interaction and regex-based string replacement in the update script require careful review, while import refactoring is straightforward. Possibly related PRs
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
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. Comment |
closes #123
Summary by CodeRabbit