-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add Script to Generate CONTRIBUTORS.md with Shields.io Badges Based on Merged PRs #600
Conversation
WalkthroughThis update introduces a new section in Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- CONTRIBUTORS.md (1 hunks)
- scripts/generate_contributors.py (1 hunks)
Files skipped from review due to trivial changes (1)
- CONTRIBUTORS.md
Additional comments not posted (10)
scripts/generate_contributors.py (10)
1-4
: LGTM!The imports are correct and necessary for the script.
5-12
: LGTM!The constants are correctly defined and using an environment variable for the GitHub token is a good practice.
14-21
: LGTM!The
get_merged_prs
function is correctly implemented and handles potential API errors.
23-31
: LGTM!The
count_contributions
function is correctly implemented and using adefaultdict
simplifies the code.
33-42
: LGTM!The
categorize_contributors
function is correctly implemented and uses a dictionary comprehension for conciseness. Breaking out of the loop ensures that each contributor is assigned to only one tier.
44-48
: LGTM!The
generate_badge
function is correctly implemented and replaces certain characters to ensure a valid URL.
50-60
: LGTM!The
generate_contributors_md
function is correctly implemented. Sorting the contributors based on their contribution count in descending order and generating the markdown content by appending lines to a list are effective approaches.
62-66
: LGTM!The
write_contributors_file
function is correctly implemented.
68-75
: LGTM!The
main
function is correctly implemented and orchestrates the execution of the script.
77-78
: LGTM!The code segment correctly checks if the script is being run as the main program and calls the
main
function.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- CONTRIBUTORS.md (1 hunks)
- scripts/generate_contributors.py (1 hunks)
Files skipped from review due to trivial changes (1)
- scripts/generate_contributors.py
Files skipped from review as they are similar to previous changes (1)
- CONTRIBUTORS.md
This PR introduces two new files:
1. generate_contributors.py:
2. CONTRIBUTORS.md:
This addition aims to recognize and showcase contributors in a visually engaging way while encouraging further community involvement.
Summary by CodeRabbit
CONTRIBUTORS.md
file to acknowledge contributors with badges, enhancing community recognition.CONTRIBUTORS.md
file to streamline contributor acknowledgment based on merged pull requests.