From 85fc0dbd53a0a75d078f64dbb9b6360d20cc7cba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 06:42:56 +0000 Subject: [PATCH 1/2] Initial plan From 2c11285a869fecad53fc643903769d6fa6201300 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 06:47:15 +0000 Subject: [PATCH 2/2] Improve contribution snippets with better templates and guidelines Co-authored-by: felipecustodio <4261743+felipecustodio@users.noreply.github.com> --- CONTRIBUTING.md | 59 ++++++++++++++++++++++++++++++++++++++-- PULL_REQUEST_TEMPLATE.md | 47 +++++++++++++++++++++++++++----- README.md | 20 +++++++++----- 3 files changed, 109 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 84d1e24..d3de74f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,42 @@ Write any algorithm, data structure demo or general application in the programming language of your choice, and open a pull request. Your request will be assigned to one of the maintainers and reviewed as soon as possible. +## Writing a Good Pull Request Description + +A well-written PR description helps maintainers understand and review your contribution quickly. Please include: + +### ✅ Good Example: +``` +## Category +- [x] Sorting Algorithm + +## Algorithm/Data Structure Description +This is a Python implementation of Merge Sort algorithm. Merge Sort is a divide-and-conquer algorithm that divides the array into halves, recursively sorts them, and then merges the sorted halves. It guarantees O(n log n) time complexity in all cases. + +## Implementation Details +**Programming Language:** Python +**Time Complexity:** O(n log n) +**Space Complexity:** O(n) +**Key Features:** Stable sort, works well with large datasets + +## Testing +- [x] Yes, with sample inputs +- [x] Yes, with edge cases +**Test cases included:** Empty array, single element, already sorted array, reverse sorted array +``` + +### ❌ Poor Examples: +- "Added algorithm" (too vague) +- "Please include a small description of your algorithm/data structure and add reference to the Hacktoberfest issue" (template not filled) +- "Hey! I added XYZ Algorithm." (no technical details) + +### Required Information: +1. **Clear algorithm/data structure name and purpose** +2. **Programming language used** +3. **Time and space complexity (if applicable)** +4. **Brief explanation of how it works** +5. **Testing status** + # Are there any rules? ### 1. Make sure to put your code in an appropriate directory @@ -15,13 +51,30 @@ pull request. Your request will be assigned to one of the maintainers and review If you don't find a proper location, feel free to create it! -### 2. Make sure to that the code you're adding is of your own creation +## Code Quality Standards + +### Documentation +- Add meaningful comments explaining complex logic +- Include function/method documentation where appropriate +- Consider adding a README.md in your algorithm's directory for complex implementations + +### Code Style +- Use descriptive variable and function names +- Follow the standard conventions for your chosen programming language +- Keep functions focused and modular when possible + +### Examples to Include +- At least one working example demonstrating your algorithm +- Sample input/output in comments or separate test file +- Edge case handling where relevant + +### 2. Make sure that the code you're adding is of your own creation If you think this goes without saying, then rest assured that this message is not for you; you most likely already abide by this rule. -[The Hacktoberfest message is strong](https://hacktoberfest.digitalocean.com/details#quality-standards), and we want to -be in tune with their values. For that however, we maintainers have to be strict when dealing with spam, which is +[Open source contribution guidelines](https://hacktoberfest.digitalocean.com/details#quality-standards) emphasize quality contributions, and we want to +be in tune with these values. For that however, we maintainers have to be strict when dealing with spam, which is plenty, unfortunately. So here's how it goes: - **Spam PRs or PRs containing blatant copies of snippets from the web will be immediately tagged `invalid` and diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 91f971e..33a3129 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,13 +1,46 @@ -### Category +## Category -**EDIT ME** How would you categorize your contribution? (Graph search, greedy algorithm, dynamic programming, machine -learning algorithm, etc... Feel free to classify your code as you see fit.) + +- [ ] Data Structure (e.g., linked list, tree, hash table) +- [ ] Sorting Algorithm (e.g., quicksort, mergesort, heapsort) +- [ ] Search Algorithm (e.g., binary search, depth-first search) +- [ ] Graph Algorithm (e.g., shortest path, minimum spanning tree) +- [ ] Dynamic Programming +- [ ] Greedy Algorithm +- [ ] Machine Learning Algorithm +- [ ] Mathematical Algorithm +- [ ] Other: _________________ -### Description +## Algorithm/Data Structure Description -**EDIT ME** Please include a small description of your algorithm. Any context you provide will help us review your code -faster and more easily. +**Please provide a clear description of what your algorithm/data structure does:** + + + +## Implementation Details + +**Programming Language:** + +**Time Complexity:** + +**Space Complexity:** + +**Key Features:** + +## Testing + +**Have you tested your implementation?** +- [ ] Yes, with sample inputs +- [ ] Yes, with edge cases +- [ ] No + +**Test cases included:** --- -:beers: Hacktoberfest (#66) +🎯 **Contributing to open source algorithms collection** diff --git a/README.md b/README.md index 54d5c16..3cd028f 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,27 @@ Hello, everyone! -Let's contribute to [**Hacktoberfest 2019**](https://hacktoberfest.digitalocean.com/) while refreshing our *data structures and algorithms* knowledge. +Welcome to our comprehensive collection of algorithms and data structures! This repository is perfect for learning, practicing, and contributing to the world of computer science fundamentals. -# [Hacktoberfest 2019 issue + Contribution Guidelines](https://github.com/pirataspinhal/algorithms/issues/126) +# 🚀 How to Contribute -Implement your favorite **data structure/algorithm/crazy magic in the programming language of your choice (the more the better!)** and open a pull request. +Implement your favorite **data structure/algorithm/computational solution in the programming language of your choice** and open a pull request. -It can be **anything!** Graph problems, sorting algorithms, dynamic programming, greedy algorithms... maybe something else entirely? Every contribution counts. +It can be **anything!** Graph problems, sorting algorithms, dynamic programming, greedy algorithms, machine learning algorithms, mathematical computations... maybe something else entirely? Every quality contribution counts. As long as it's your own authentic piece of code, it's welcome! :wink: +## 📚 Getting Started - Never contributed to a public repository before? [This is a good place to start](https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/#summary) - - Want tips on how to write short and sweet commit messages? [Check out this great article](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - -- Make sure to engage the community in a constructive manner! [**Please read our rules and guidelines before contributing**](https://github.com/pirataspinhal/algorithms/issues/126) +- **Make sure to read our [contribution guidelines](CONTRIBUTING.md) before submitting your pull request!** + +## 🎯 What Makes a Great Contribution? +- Clear, well-documented code +- Descriptive pull request with algorithm explanation +- Time and space complexity analysis +- Test cases or examples +- Proper directory organization # Credits