Skip to content

Latest commit

 

History

History
217 lines (171 loc) · 6.66 KB

File metadata and controls

217 lines (171 loc) · 6.66 KB

🤝 Contributing to Open Source Playground

Thank you for your interest in contributing! This guide will help you make your first contribution to open source.

📋 Table of Contents

🚀 Getting Started

Prerequisites

  • A GitHub account
  • Git installed on your computer
  • Basic knowledge of using the command line (don't worry, we'll guide you!)

First Time Setup

  1. Install Git: Download from git-scm.com
  2. Configure Git (replace with your information):
    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"

🎯 Types of Contributions

🌟 Beginner Friendly

  • Add yourself to CONTRIBUTORS.md: Perfect first contribution!
  • Fix typos: Help improve our documentation
  • Add Hello World programs: Share your favorite programming language

🔥 Intermediate

  • Improve existing examples: Make code more readable or efficient
  • Add new example programs: Calculators, simple games, utilities
  • Enhance documentation: Add explanations, improve formatting

🚀 Advanced

  • Code review: Help review other contributors' pull requests
  • Project structure: Improve organization and workflows
  • Mentoring: Help guide new contributors

📖 Step-by-Step Guide

Step 1: Fork the Repository

  1. Go to the Open Source Playground repository
  2. Click the "Fork" button in the top-right corner
  3. This creates your own copy of the repository

Step 2: Clone Your Fork

# Replace YOUR_USERNAME with your GitHub username
git clone https://github.com/YOUR_USERNAME/Open-Source-Playground.git
cd Open-Source-Playground

Step 3: Create a New Branch

# Use a descriptive branch name
git checkout -b add-my-name
# or
git checkout -b add-python-calculator
# or  
git checkout -b fix-readme-typo

Step 4: Make Your Changes

Adding Yourself to CONTRIBUTORS.md

  1. Open CONTRIBUTORS.md
  2. Find the "Add your name above this line!" comment
  3. Add your information following this format:
### [Your Name](https://github.com/yourusername)
- **Fun Fact**: Something interesting about you!
- **Favorite Programming Language**: Your favorite language
- **Location**: Your city/country (optional)
- **First Contribution Date**: YYYY-MM-DD

Adding a Code Example

  1. Navigate to the appropriate language folder in examples/
  2. If your language folder doesn't exist, create it:
    mkdir examples/your-language
  3. Add your program file with a descriptive name
  4. Include comments explaining what the code does

Step 5: Test Your Changes

  • If you added code, make sure it runs without errors
  • Check that file formatting looks good
  • Verify links work in markdown files

Step 6: Commit Your Changes

# Add your changes
git add .

# Commit with a clear message
git commit -m "Add John Doe to contributors list"
# or
git commit -m "Add Python hello world example"
# or
git commit -m "Fix typo in README.md"

Step 7: Push to Your Fork

git push origin your-branch-name

Step 8: Create a Pull Request

  1. Go to your fork on GitHub
  2. Click "Compare & pull request"
  3. Fill out the pull request template:
    • Title: Clear, descriptive title
    • Description: Explain what you changed and why
  4. Click "Create pull request"

📝 Code Guidelines

File Naming

  • Use lowercase with hyphens: hello-world.py, simple-calculator.js
  • Be descriptive: fibonacci-sequence.cpp instead of fib.cpp

Code Style

  • Include comments: Explain what your code does
  • Keep it simple: Focus on readability over complexity
  • Add a header comment: Include your name and what the program does

Example Header Format

# Hello World in Python
# Author: Your Name
# Description: A simple program that prints "Hello, World!"

print("Hello, World!")

Documentation

  • README files: Add a README.md in language folders explaining how to run the code
  • Clear instructions: Assume the reader is a beginner
  • Examples: Show expected output

🔄 Pull Request Process

What Happens After You Submit?

  1. Automatic checks: Basic validations run automatically
  2. Review: Maintainers will review your contribution
  3. Feedback: You might receive suggestions for improvements
  4. Merge: Once approved, your changes will be merged!

PR Requirements

  • ✅ Clear title and description
  • ✅ Code works and is tested
  • ✅ Follows project guidelines
  • ✅ No merge conflicts

Responding to Feedback

  • Don't take feedback personally - it's about the code, not you!
  • Ask questions if you don't understand
  • Make requested changes in your existing branch
  • Push changes to automatically update the PR

🆘 Getting Help

Common Issues

"I can't push to the repository"

  • Make sure you're pushing to your fork, not the original repository
  • Check that you're on the correct branch

"My pull request has merge conflicts"

  • This happens when the main branch has changed since you started
  • Ask for help in the pull request comments - we're happy to guide you!

"I made a mistake in my commit"

  • Don't worry! You can make additional commits to fix issues
  • Or ask for help to learn about git commit --amend

Where to Ask for Help

  • GitHub Issues: Open an issue with the "help wanted" label
  • Pull Request Comments: Ask questions directly in your PR
  • Community Discussions: Use GitHub Discussions for general questions

🏆 Recognition

All contributors will be:

  • Added to our README contributors section
  • Recognized in release notes
  • Part of our amazing open source community!

📚 Learning Resources

Git and GitHub

Open Source


🎉 Ready to Contribute?

We're excited to see your contribution! Remember:

  • Start small: Your first PR can be as simple as adding your name
  • Ask questions: We're here to help
  • Have fun: Open source should be enjoyable!

Every expert was once a beginner. Welcome to the community! 🌟