mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-29 22:24:07 +01:00
67 lines
4.6 KiB
Markdown
67 lines
4.6 KiB
Markdown
# Contributing guidelines
|
|
|
|
## Before contributing
|
|
|
|
Welcome to [TheAlgorithms/Ruby](https://github.com/TheAlgorithms/Ruby)! Before sending your pull requests, make sure that you **read the whole guidelines**. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Ruby/issues/new) or ask the community in [Gitter](https://gitter.im/TheAlgorithms).
|
|
|
|
## Contributing
|
|
|
|
### Contributor
|
|
|
|
We are very happy that you consider implementing algorithms and data structure for others! This repository is referenced and used by learners from all over the globe. Being one of our contributors, you agree and confirm that:
|
|
|
|
- You did your work - no plagiarism allowed
|
|
- Any plagiarized work will not be merged.
|
|
- Your work will be distributed under [MIT License](LICENSE.md) once your pull request is merged
|
|
- You submitted work fulfils or mostly fulfils our styles and standards
|
|
|
|
**New implementation** is welcome! For example, new solutions for a problem, different representations for a graph data structure or algorithm designs with different complexity but **identical implementation** of an existing implementation is not allowed. Please check whether the solution is already implemented or not before submitting your pull request.
|
|
|
|
**Improving comments** and **writing proper tests** are also highly welcome.
|
|
|
|
### Contribution
|
|
|
|
We appreciate any contribution, from fixing a grammar mistake in a comment to implementing complex algorithms. Please read this section if you are contributing your work.
|
|
|
|
Your contribution will be tested by our [automated testing on Travis CI](https://travis-ci.org/TheAlgorithms/Ruby/pull_requests) to save time and mental energy. After you have submitted your pull request, you should see the Travis tests start to run at the bottom of your submission page. If those tests fail, then click on the ___details___ button try to read through the Travis output to understand the failure. If you do not understand, please leave a comment on your submission page and a community member will try to help.
|
|
|
|
Please help us keep our issue list small by adding fixes: #{$ISSUE_NO} to the commit message of pull requests that resolve open issues. GitHub will use this tag to auto close the issue when the PR is merged.
|
|
|
|
#### What is an Algorithm?
|
|
|
|
An Algorithm is one or more functions (or classes) that:
|
|
* take one or more inputs,
|
|
* perform some internal calculations or data manipulations,
|
|
* return one or more outputs,
|
|
* have minimal side effects.
|
|
|
|
Algorithms should be packaged in a way that would make it easy for readers to put them into larger programs.
|
|
|
|
Algorithms should:
|
|
|
|
* have intuitive class and function names that make their purpose clear to readers
|
|
* use Ruby naming conventions and intuitive variable names to ease comprehension
|
|
* be flexible to take different input values
|
|
* have Ruby type hints for their input parameters and return values
|
|
* raise Ruby exceptions on erroneous input values
|
|
* return all calculation results instead of printing or plotting them
|
|
|
|
Algorithms in this repo should not be how-to examples for existing Ruby packages. Instead, they should perform internal calculations or manipulations to convert input values into different output values. Those calculations or manipulations can use data types, classes, or functions of existing Ruby packages but each algorithm in this repo should add unique value.
|
|
|
|
#### Other Requirements for Submissions
|
|
|
|
- If you are submitting code in the `project_euler/` directory, please also read [the dedicated Guideline](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/README.md) before contributing to our Project Euler library.
|
|
- Strictly use snake_case (underscore_separated) in your file_name, as it will be easy to parse in future using scripts.
|
|
- Please avoid creating new directories if at all possible. Try to fit your work into the existing directory structure.
|
|
- If possible, follow the standard *within* the folder you are submitting to.
|
|
- If you have modified/added code work, make sure the code compiles before submitting.
|
|
- If you have modified/added documentation work, ensure your language is concise and contains no grammar errors.
|
|
- Do not update the `README.md` or `DIRECTORY.md` file which will be periodically autogenerated by our Travis CI processes.
|
|
- Add a corresponding explanation to [Algorithms-Explanation](https://github.com/TheAlgorithms/Algorithms-Explanation) (Optional but recommended).
|
|
|
|
- Most importantly,
|
|
- **Be consistent in the use of these guidelines when submitting.**
|
|
- **Join** [Gitter](https://gitter.im/TheAlgorithms) **now!**
|
|
- Happy coding!
|
|
|
|
Writer [@vbrazo](https://github.com/vbrazo), Dec 2020.
|