Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribution Guidelines #5

Open
AkashM398 opened this issue Oct 5, 2019 · 4 comments
Open

Contribution Guidelines #5

AkashM398 opened this issue Oct 5, 2019 · 4 comments

Comments

@AkashM398
Copy link
Member

AkashM398 commented Oct 5, 2019

Contributing

Resources

GIT

How to contribute your code?

  • Have a look at open issues. They contain the list of algorithms/DS we plan to be implemented. Pick an unassigned issue.
  • You can also create a new issue for an algorithm that is not in the list.
  • Make sure you are assigned for the issue.
  • Code the algorithm/DS following the styleguide defined below.
  • Send a PR.
  • Be sure to not include any compiled binaries in the patch.
  • While sending a PR make sure you follow one issue per PR rule.

Suggesting an algorithm / DS

  • First make sure you are not suggesting a duplicate.

  • If not, proceed and create the issue. Make sure that you specify only one language in an issue. Create multiple issues for different languages.

  • Title of issue should be of the following format -

     [Algo/Data Structure] Algorithm/DS Name [Language]
    
  • Please include at least one external link for the algorithm/DS in the issue's body for each issue. The link should explain the algorithm/problem/DS in detail.

Use a Consistent Coding Style

  • Code submitted should be modular.
  • Don't use global variables.
  • Use separate folders for each concept. Folder name should be in full lowercase. If the algorithm/DS name has multiple words, separate them by underscores. (eg longest_common_subsequence)
  • Filename should be derived from the folder name. (e.g, longest_common_subsequence becomes
    longest_common_subsequence.c or
    longest_common_subsequence.java)
  • Name of master function of the code should be kept same as filename to the best extent possible.
  • Prefer classes instead of multiple helper functions (where applicable).
  • Currently we are accepting contributions in C, C++, Java and Python but other languages may be considered after a discussion.
  • Define tester code only in main routine.
  • Use meaningful variable, method and function names and comments.
  • No profanity.
  • Use external libraries only when no other solution is possible/plausible.
  • We have defined skeleton codes for some popular languages below. Please follow them whenever possible.

Shortlog

Example:

quicksort.py: Add QuickSort Algorithm 
  • Maximum of 50 characters.
    Keeping subject lines at this length ensures that they are readable, and explains the change in a concise way.

  • Should describe the change - the action being done in the commit.

  • Should not include WIP prefix.

  • Should have a tag and a short description separated by a colon (:)

    • Tag
      • The file or class or package being modified.
      • Not mandatory.
    • Short Description
      • Starts with a capital letter.
      • Written in imperative present tense (i.e. Add something, not Adding something or Added something).
      • No trailing period.

Commit Body

Example:

This adds QuickSort Algorithm which return the concatenation of the quicksorted list of elements that are less than or equal to the pivot, the pivot, and the quicksorted list of elements that are greater than the pivot.

  • Maximum of 72 chars excluding newline for each line.

    The recommendation is to add a line break at 72 characters, so that Git has plenty of room to indent text while still keeping everything under 80 characters overall.
  • Not mandatory - but helps explain what you’re doing.

  • Should describe the reasoning for your changes. This is especially important for complex changes that are not self explanatory. This is also the right place to write about related bugs.

  • First person should not be used here.

Credits - FnPlus

@AkashM398 AkashM398 added this to the Hacktoberfest milestone Oct 5, 2019
@AkashM398 AkashM398 pinned this issue Oct 5, 2019
@rohitjmathew
Copy link
Contributor

rohitjmathew commented Oct 5, 2019

@AkashM398 This can be converted into a CONTRIBUTING.md

I shall pick this up and add it.

@AkashM398
Copy link
Member Author

Hello @rohitjmathew, you could find the CONTRIBUTING.md in the asset directory, you can create a new issue if you would like add some useful information.

@rohitjmathew
Copy link
Contributor

rohitjmathew commented Oct 5, 2019

Hey, thanks for the quick reply.

Generally, a CONTRIBUTING.md is kept on the root directory of the project to make it easy for potential contributors to understand the project and its relevant guidelines. I suggest moving it to the root directory.

@AkashM398
Copy link
Member Author

AkashM398 commented Oct 5, 2019

Thank you for your suggestion, appreciated!!

@abhiramready abhiramready unpinned this issue Oct 5, 2019
@AkashM398 AkashM398 pinned this issue Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants