code-park

Contributing to Code Park

Become part of our Code Park family by contributing. Your support not only adds you to our community but also fuels the spread of knowledge! 🌳 Before you get started, please take a moment to review the guidelines below to ensure a smooth and collaborative experience.

Table of Contents

General Guidelines

  1. Be Respectful: Always be courteous and respectful towards other contributors. Encourage a positive and inclusive community.

  2. Avoid Binary and Executable Files: Please refrain from uploading any binary or executable files. The focus of this repository is on clear and concise code implementations.

  3. Follow Code Etiquette: Ensure that your code is well-commented for clarity. Follow the coding standards relevant to the language you are using.

  4. Restrictions:
    • Do not modify or remove any folder or file in this reposity starting with (.) or all the letters are in uppercase. These are called admin files. Place an proper issue in github if you wanna suggest any modification here.
    • Currently we are only accepting codes in [c, c++, py, java], which is best for raw code and DSA.
  5. Before Submission:
    • Make sure you removed all the unnecessary folders/files.
    • run READY_REPO.py which will check the status of your updates.
  6. Reasons for Direct Pull Request Rejection:
    • Modify any admin folder/file (starts with . or all uppercase).
    • Absence/inappropriate comments in the code.
    • Did not follow code placement.
    • Irrelevant commit message.
  7. Python dev
    • If you are using any virtual environment, make sure its name is one of [“venv”, “virtual_env”, “environment”]

Structure

The repository is organized into folders based on different topics and programming languages. To maintain a structured and organized codebase, please adhere to the following guidelines:

Folder Naming:

Code File Naming:

Code Placement

If you want to contribute code on a specific topic and there is already an existing folder related to that topic, please follow these guidelines:

  1. Existing Folder: If a relevant folder already exists, do not create a new one.
  2. File Placement: Place your code file directly inside the existing folder.
  3. Folder Creation: Only create a new folder if there is no existing folder related to your code topic.

DO NOT CREATE NESTED FOLDER

Coding Style

We believe that a coder is an artist, and we cannot teach an artist how to be creative. Therefore, feel free to write code as you wish. However, to reduce bugs and improve performance, please follow the rules below:

Example Code:

#include<stdio.h>

/*
return summation of two number.

@param number1
@param number2

@return sum of number1 and number2
*/
long long sum(long long a, long long b)
{
   // returning sum of the numbers
   return a + b;
}

int main()
{
   int x = 1, y = 2;
   int sum = sum()
}

Submitting Contributions

Follow these steps to submit your contribution:

  1. Fork the Repository: Click the “Fork” button on the Code Park repository.
  2. Create a Branch: Create a new branch for your changes.
  3. Make Changes: Add your code following the guidelines mentioned above.
  4. Commit Changes: Commit your changes with descriptive commit messages.
  5. Push Branch: Push your branch to your fork of the repository.
  6. Submit Pull Request: Open a pull request with details about your changes.

if you are working locally(obviously after cloning your forked repository),

it is always recommanded to use git pull command before making any change in the repository. If you get Already up to date. then your repository already synced with the original repository. Else it will be synced.

If you are using vs code, make sure you installed GitLens for better support.

image

and before start doing your work, press the button at the left buttom,

image

If you are using tarminal/cmd/powershell, use git push, If you see any messages like,

Your branch and 'origin/master' have diverged

it means your repository is not synced with the original repository but you made a change. Do not panic,The simplest solution is,

If you encounter difficulties contributing via GitHub, Please search the internet and read some documentations. There is no alternative method for contribution outside of GitHub

Thank you for contributing to Code Park! Your efforts help create a valuable resource for developers around the world.

Happy coding! 🚀