Skip to content

Latest commit

 

History

History
106 lines (74 loc) · 5.1 KB

CONTRIBUTING.md

File metadata and controls

106 lines (74 loc) · 5.1 KB

Contributing to AlgoGenesis - C Algorithms

Thank you for considering contributing to the AlgoGenesis C algorithms repository! We appreciate your interest in improving this project. To ensure a smooth collaboration, please follow the steps outlined below.


How to Contribute

1. Fork the Repository

First, fork the repository to your GitHub account. This will allow you to make changes in your own copy of the project.

  1. Navigate to the main repository: AlgoGenesis/C
  2. Click the "Fork" button in the upper right corner.
  3. You will now have a personal copy of the repository under your GitHub account.

2. Create a New Branch

Once the repository is forked, create a new branch in your fork to work on your contribution.

  1. Clone your fork to your local machine:
    git clone https://github.com/YourUsername/C.git
    cd C
  2. Create a new branch for your feature or fix:
    git checkout -b feature/algorithm-name

3. Request Assignment for an Issue

Before working on a new feature, algorithm, or issue, it is mandatory to be assigned by a maintainer. This helps avoid redundant work and ensures that the task is aligned with the project goals.

  • Navigate to the repository's Issues page.
  • If an issue is already open, comment on the issue asking to be assigned.
  • If no relevant issue exists, create a new one detailing your proposed contribution and ask for assignment.

Note: Do not start working on an issue until it has been assigned to you by a maintainer.

4. Write Your Code

Once you have been assigned an issue, you can start working on it. Please ensure the following:

  • Your code adheres to the C11 standard for maximum portability.
  • The code is clean, modular, and well-documented.
  • Use comments to explain key sections of the algorithm.
  • Include self-checks where applicable to ensure the correctness of your implementation.

5. Test Your Changes

It is important that your code is well-tested before submission. Test your algorithm or fix in multiple cases to ensure it behaves as expected.

  • Make sure your code compiles without warnings.
  • Test your code on both MacOS and Linux systems, if possible.
  • If your contribution includes an optimization, compare it against other implementations in the repository (if available).

6. Commit Your Changes

Once your changes are ready, commit them to your branch.

  1. Stage your changes:
    git add .
  2. Commit your changes with a meaningful commit message:
    git commit -m "Add implementation of algorithm-name"

7. Push Your Branch to GitHub

After committing your changes, push your branch to your fork on GitHub. ```bash git push origin feature/algorithm-name

8. Submit a Pull Request

With your branch pushed, you can now submit a pull request (PR) to the main repository.

  1. Go to your forked repository on GitHub.
  2. Click the "Compare & pull request" button next to your branch.
  3. In the PR description, provide details about the algorithm or fix, why it’s important, and any additional notes.
  4. Submit the pull request for review.

9. Wait for Code Review

Once you have submitted a PR, the project maintainers will review your contribution. Be prepared to make revisions if requested.

  • PR Review Process: The maintainers will check your code for correctness, style, and adherence to project guidelines. They may request changes before approving the PR.

Contribution Guidelines

  • New Algorithms: Each algorithm should be self-contained in its own file with a clear filename that indicates the algorithm's purpose (e.g., bubble_sort.c).
  • Comments and Documentation: Include comments in the code explaining what each section of the algorithm is doing. This helps learners understand the implementation.
  • Code Quality: Follow best practices in C programming and ensure the code is optimized for performance and readability.
  • Testing: Ensure that the code is thoroughly tested, including edge cases.
  • Commit Messages: Write descriptive and concise commit messages that clearly state what your contribution is about.

Code of Conduct

This project and everyone participating in it are expected to adhere to our [Code of Conduct](link to code of conduct). Please read it to understand the behavior we expect from contributors.


Thank You for Your Contribution!

By following these guidelines, you help ensure that the project remains a high-quality resource for everyone in the community. We appreciate your time and effort in making AlgoGenesis better!

Key Points:

  • The contributor must wait to be assigned by a maintainer before starting work on any issue or feature.
  • Detailed steps are provided for forking, creating branches, committing code, and submitting pull requests.
  • Guidelines ensure that contributions are up to standard, including C11 standard adherence, self-checks, and testing.

Feel free to adjust the repository URLs and specific links like the Issues page to fit your actual repo structure. Let me know if you'd like further adjustments!