|
| 1 | +# Contributing Guidelines |
| 2 | + |
| 3 | +This documentation contains a set of guidelines to help you during the contribution process. |
| 4 | + |
| 5 | +We are happy to welcome all the contributions from anyone willing to improve/add new scripts to this project. Thank you for helping out and remember, **no contribution is too small.** |
| 6 | + |
| 7 | +- Each participant/contributor will be assigned **2 issues (max)** at a time to work. |
| 8 | +- Participants are expected to follow project guidelines and coding style. Structured code is one of our top priorities. |
| 9 | +- Participants/contributors have **7 days** to complete issues. After that issues will be assigned to others. |
| 10 | +- Participants/contributors have to **comment** on issues they would like to work on, and mentors will assign you. |
| 11 | +- Issues will be assigned on a **first-come, first-serve basis**. |
| 12 | +- Participants/contributors can also **open their issues**, but it needs to be verified and labelled by a mentor. |
| 13 | +- Before opening a new issue, please **check** if it is already created or not. |
| 14 | +- Pull requests will be merged after being **reviewed by a mentor**. |
| 15 | +- Create a pull request from a **branch** other than `main`. |
| 16 | +- It might take a day to review your pull request. Please have patience and be nice. |
| 17 | +- We all are here to learn. You are allowed to make mistakes. That's how you learn, right! |
| 18 | + |
| 19 | +- **MAKE SURE TO OPEN A DRAFT PR AS SOON AS YOU START WORKING ON AN ISSUE AND KEEP COMMITTING TO IT SO THAT WE CAN KNOW THAT YOU ARE WORKING ON THAT PARTICULAR ISSUE** |
| 20 | + |
| 21 | +- Pull Requests review criteria: |
| 22 | + - Please fill the **PR template** properly while making a PR |
| 23 | + - Example of the **PR template** |
| 24 | + |
| 25 | +  |
| 26 | + |
| 27 | + - You must add your code file into the respective **folders**. |
| 28 | + - Your work must be **original**, written by you not copied from other resources. |
| 29 | + - You must **comment** on your code where necessary. |
| 30 | + - For **frontend changes** kindly share screenshots and work samples of your work before sending a PR. |
| 31 | + - Follow the proper [**style guides**](https://google.github.io/styleguide/) for your work. |
| 32 | + |
| 33 | +- For any queries or discussions, please drop a message in our **SWOC slack channel or DWOC discord server** |
| 34 | + |
| 35 | +# Submitting Contributions👩💻👨💻 |
| 36 | +Below you will find the process and workflow used to review and merge your changes. |
| 37 | + |
| 38 | +## Step 0 : Find an issue 🔍 |
| 39 | +- Take a look at the Existing Issues or create your **own** Issues! |
| 40 | +- Wait for the Issue to be assigned to you after which you can start working on it. |
| 41 | +- Note : Every change in this project should/must have an associated issue. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +## Step 1 : Fork the Project 🍴 |
| 46 | +- Fork this Repository. This will create a Local Copy of this Repository on your Github Profile. Keep a reference to the original project in `upstream` remote. |
| 47 | +``` |
| 48 | +$ git clone https://github.com/<your-username>/Community-Website |
| 49 | +$ cd <repo-name> |
| 50 | +$ git remote add upstream https://github.com/HITK-TECH-Community/Community-Website |
| 51 | +``` |
| 52 | + |
| 53 | + |
| 54 | +- Update your forked repo before working. |
| 55 | +``` |
| 56 | +$ git remote update |
| 57 | +$ git checkout <branch-name> |
| 58 | +$ git rebase upstream/<branch-name> |
| 59 | +``` |
| 60 | +## Step 2 : Branch 🔖 |
| 61 | +Create a new branch. Use its name to identify the issue you are addressing. |
| 62 | +``` |
| 63 | +# It will create a new branch with name Branch_Name and switch to that branch |
| 64 | +$ git checkout -b branch_name |
| 65 | +``` |
| 66 | + |
| 67 | + |
| 68 | +## Step 3 : Work on the issue assigned 📕 |
| 69 | +- Work on the issue(s) assigned to you. |
| 70 | +- Add all the files/folders needed. |
| 71 | +- After you've made changes or made your contribution to the project add changes to the branch you've just created by using terminal: |
| 72 | +``` |
| 73 | +# To add all new files to branch Branch_Name |
| 74 | +$ git add . |
| 75 | +
|
| 76 | +# To add only a few files to Branch_Name |
| 77 | +$ git add <some files> |
| 78 | +``` |
| 79 | +- Using GitHub: |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +## Step 4 : Commit |
| 84 | +- To commit give a descriptive message for the convenience of reviewer by using terminal: |
| 85 | +``` |
| 86 | +# This message get associated with all files you have changed |
| 87 | +$ git commit -m "message" |
| 88 | +``` |
| 89 | +- Using GitHub |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +### Commit message guidelines |
| 94 | +- Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject: |
| 95 | +``` |
| 96 | +<type>(<scope>): <subject> |
| 97 | +<BLANK LINE> |
| 98 | +<body> |
| 99 | +<BLANK LINE> |
| 100 | +<footer> |
| 101 | +``` |
| 102 | +Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools |
| 103 | + |
| 104 | +### Example commit message |
| 105 | +``` |
| 106 | +feat(Profile): display QR code |
| 107 | +
|
| 108 | +fetch the QR code from API and display it on the Profile page (ProfileFragment.kt) |
| 109 | +
|
| 110 | +fixes #1234 |
| 111 | +``` |
| 112 | +A good rule of thumb for the commit message is to have a present tense verb, followed by whatever it is you're doing in as much detail as possible in 50 chars. Capitalize words correctly and follow general English. |
| 113 | +### For more details, visit |
| 114 | +- [Git commit message guidelines](http://karma-runner.github.io/0.13/dev/git-commit-msg.html) |
| 115 | +- [Writing Good Commit Messages: A Practical Git Guide](https://www.freecodecamp.org/news/writing-good-commit-messages-a-practical-guide/) |
| 116 | + |
| 117 | +## Step 5 : Work Remotely |
| 118 | +- Now you are ready to your work in the remote repository. |
| 119 | +- When your work is ready and complies with the project conventions, upload your changes to your fork: |
| 120 | + |
| 121 | +``` |
| 122 | +# To push your work to your remote repository |
| 123 | +$ git push -u origin <branch_name> |
| 124 | +``` |
| 125 | + |
| 126 | + |
| 127 | +## Step 6 : Pull Request 🎣 |
| 128 | +- Go to your repository in the browser and click on compare and pull requests. Then add a title and description to your pull request that explains your contribution. |
| 129 | +- Compare |
| 130 | +- Create pull request |
| 131 | + |
| 132 | +- Voila! Your Pull Request has been submitted and will be reviewed by the moderators and merged.🥳 |
| 133 | + |
| 134 | +## Need more help?🤔 |
| 135 | +You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, in case you are stuck: |
| 136 | +- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) |
| 137 | +- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-an-issue-or-pull-request) |
| 138 | +- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github) |
| 139 | +- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6) |
| 140 | +- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github) |
| 141 | + |
| 142 | + |
| 143 | +## Tip from us😇 |
| 144 | +It always takes time to understand and learn. So, do not worry at all. We know **you have got this**!💪 |
| 145 | + |
| 146 | + |
0 commit comments