Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Transform contrib-checker into a Full-Featured Python Library
Summary
This PR transforms contrib-checker from a simple GitHub Action into a comprehensive, installable Python library while maintaining 100% backward compatibility. The tool now supports multiple usage patterns: Python library, CLI tool, GitHub Action, and GitLab CI integration.
🎯 Key Achievements
✅ Complete Library Transformation
pip install contrib-checkercontrib-checkerCLI for local usage✅ Comprehensive Testing
📦 New Package Structure
🛠️ Installation & Usage
Python Package Installation
Command-line Usage
Library Usage
🔧 Architecture Improvements
Eliminated Code Duplication
check_contributors.py) and GitLabcontrib_checker.core.ContributorCheckerSmart Wrapper Pattern
All platform scripts now use a smart wrapper pattern:
Clean API Design
ContributorCheckerclassGitHubContributorChecker,GitLabContributorChecker(success: bool, results: dict)📋 Files Changed
New Package Files
contrib_checker/__init__.py- Package exports and public APIcontrib_checker/core.py- Core contributor checking logic (refactored from existing code)contrib_checker/github.py- GitHub integration with PR commentingcontrib_checker/gitlab.py- GitLab integration with MR commentingcontrib_checker/cli.py- Command-line interface implementationDistribution & Configuration
pyproject.toml- Modern Python packaging configurationsetup.py- Backward compatibility setup scriptMANIFEST.in- Include additional files in distributionrequirements.txt- Updated dependenciesUpdated Action & CI
action.yml- Updated to install package instead of copying files.github/workflows/pytest.yml- Added comprehensive test automationEnhanced Documentation
README.md- Complete rewrite with library usage examplesLIBRARY_SUMMARY.md- Detailed transformation documentationCONTRIBUTING.md- Development guidelinesexamples/library_usage.py- Comprehensive usage examplesComprehensive Test Suite
tests/test_core.py- Core functionality teststests/test_github.py- GitHub integration teststests/test_gitlab.py- GitLab integration teststests/test_cli.py- Command-line interface teststests/test_integration.py- End-to-end workflow teststests/conftest.py- Shared test fixtures🔄 Backward Compatibility
Zero Breaking Changes
mode,ignore_emails,ignore_logins)Preserved Files (now smart wrappers)
check_contributors.py- GitHub Action script (now wrapper)🧪 Testing Coverage
Test Statistics
Test Categories
🔍 Key Features
Enhanced Bot Filtering
dependabot[bot],github-actions[bot])Robust Git Integration
git log --use-mailmapfor canonical contributor names--from-shato--to-sha)Flexible Configuration
.github/contrib-metadata-check.yml)Comprehensive Metadata Support
CITATION.cffparsing with full schema supportcodemeta.jsonparsing for multiple contributor types