Skip to content

Instantly share code, notes, and snippets.

@mayankshah1607
Last active July 7, 2020 08:30
Show Gist options
  • Save mayankshah1607/7afa91c148cde695ac087c403174fe95 to your computer and use it in GitHub Desktop.
Save mayankshah1607/7afa91c148cde695ac087c403174fe95 to your computer and use it in GitHub Desktop.
This gist is a sample of CONTRIBUTING.md for Enigma 6 code repo.

Contributing Guidelines

This doc defines a set of rules and protocols that must be strictly followed while contributing to this repository.

1. Commit messages

  • Use the -m flag only for minor changes. The message following the -m flag must be of the below format :

    <Verb in present tense> <Action>

    Examples of valid messages:

    • Added routes/routes.js file
    • Update utils/validator.js file
    • Change functionality of authentication process

    Examples of invalid messages:

    • Routes.js has been updates
    • Almost finished testing
    • All changes done, ready for production :))
  • Before opening a PR, make sure you squash all your commits into one single commit using git rebase (squash). Instead of having 50 commits that describe 1 feature implementation, there must be one commit that describes everything that has been done so far. You can read up about it here.

NOTE: While squashing your commits to write a new one, do not make use of -m flag. In this case, a text editor window shall open. Write a title for the commit within 50-70 characters, leave a line and add an understandable description.

3. Issues

  • Issues MUST be opened any time any of the following events occur :
    1. You encounter an issue such that a major (50 lines of code or above) portion of the code needs to be changed/added.
    2. You want Feature enhancements
    3. You encounter Bugs
    4. Code refactoring is required
    5. Adding more tests
  • Open issues with the given template only.
  • Feel free to label the issues appropriately.
  • Do not remove the headings (questions in bold) while opening an issue with the given template. Simply append to it.

4. Branches and PRs

  • No commits must be made to the master branch directly. The master branch shall only consist of the working code.

  • Developers are expected to create new branches, and upon successful development and testing, a PR (pull request) must be opened to merge with master.

  • A branch must be named as either as the feature being implemented, or the issue being fixed.

    Examples of valid brach names:

    • #8123 (issue number)
    • OAuth (feature)
    • questionsUtils (functionality of the questions)

    ❌ __Examples of invalid branch names:

    • John
    • TajMahal
    • SomethingRandom
    • Pizza

5. Project Structure

This code repository must strictly follow the below project structure and organisation :

  |-/
    |- /controllers
          |- controller1.js (example file name)
          |- controller2.ks
          ...
    |- /middlewares
          |- middlerware1.js (example file name)
          |- middleware2.js
          ...
    |- /routes
          |- route1.js (example file name)
          |- route2.js
          ...
    |- /tests
          |- test1.js (example file names)
          |- test2.js
          ...
    ....

You can add more folders under / if required, as long as the files under it are organised semantically according to its functionality

6. Coding ethics

  • It is recommended that developers add comments wherever necessary.

    The code must be self-documented.

    For more info, click here (recommended)

  • Follow the airbnb JavaScript style guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment