From 64a55d1f193f0f4f4c40e952039350ff3cc7b9a8 Mon Sep 17 00:00:00 2001 From: Carlos Abraham Date: Wed, 10 Oct 2018 12:01:07 -0400 Subject: [PATCH 1/4] add algorithms to changelog --- changelog.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 558ec82..71baf9e 100644 --- a/changelog.md +++ b/changelog.md @@ -8,7 +8,23 @@ Date: October 9, 2018 ### Algorithms: -- Sorting +- ### Sorting - Bubble Sort -- Searches +- ### Searches - Merge Sort + +# Version `0.0.1` + +Date: TO ADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD, 2018 + +### Algorithms: + +Added: + +- ### Searches + - Bubble Sort + - Cocktail Shaker Sort + - Insertion Sort + - Pigeonhole Sort + - Selection Sort + - Stooge Sort From 4744f6de06ea93c3b03a21d10e3c4b5f6ecd9e76 Mon Sep 17 00:00:00 2001 From: Carlos Abraham Date: Wed, 10 Oct 2018 12:28:03 -0400 Subject: [PATCH 2/4] add contributing guide --- .github/code-of-conduct.md | 40 ++++++++++++ .github/contributing.md | 102 +++++++++++++++++++++++++++++++ .github/issue_template.md | 21 +++++++ .github/pull_request_template.md | 23 +++++++ docs/readme.md | 4 +- readme.md | 2 + 6 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 .github/code-of-conduct.md create mode 100644 .github/contributing.md create mode 100644 .github/issue_template.md create mode 100644 .github/pull_request_template.md diff --git a/.github/code-of-conduct.md b/.github/code-of-conduct.md new file mode 100644 index 0000000..f809c8b --- /dev/null +++ b/.github/code-of-conduct.md @@ -0,0 +1,40 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/contributing.md b/.github/contributing.md new file mode 100644 index 0000000..28fa900 --- /dev/null +++ b/.github/contributing.md @@ -0,0 +1,102 @@ +## Contributing + +> Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md). By participating in this project you agree to abide by its terms. + +## See + +- [General Rules](#general-rules) +- [All ▲lgorithms Structure](#all-▲lgorithms-structure) +- [Adding new algorithms](adding-new-algorithms) +- [Style](#style) +- [Adding Documentation](#adding-documentation) +- [Run it online](#run-it-online) + +### General Rules + +- As much as possible, try to follow the existing format of markdown and code. + +### All ▲lgorithms Python Library Structure + +- Directories and files are all in lower case letter. +- Files are separated by an underscore (`_`) following the `snake_case` style. +- Directories in documentation are separated by a minus or hyphen (`-`) following `kebeab-case` style. + +> We follow this structure + +``` +├── allalgorithms +│ │── sorting +| | │── bubble_sort.py +| | └── merge_sort.py +│ └── searches +| │── binary_search.py +| └── linear_search.py +├── docs +│ │── sorting +| | │── bubble-sort.md +| | └── merge-sort.md +│ └── searches +| │── binary-search.md +| └── linear-search.md +└── tests + │── test_searches.py + └── test_sorting.py +``` + +### Adding new algorithms + +- Make your pull requests to be **specific** and **focused**. Instead of contributing "several algorithms" all at once contribute them all one by one separately (i.e. one pull request for "Binary Search", another one +for "Bubble Sort" and so on). +- Describe what you do in code using **comments**. + +### Style + +This repository follow the [PEP8 Style Gide for Python](https://www.python.org/dev/peps/pep-0008/), so make sure you lint your code before adding a new pull request. + +Each `.py` file should have the following header. (no for testing files) + +```py +# -*- coding: UTF-8 -*- +# +# Binary search works for a sorted array. +# The All ▲lgorithms library for python +# +# Contributed by: Carlos Abraham Hernandez +# Github: @abranhe +# +``` + +If the algorithm is modified, this should be included there also. + +```py +# Contributed by: Carlos Abraham Hernandez +# Github: @abranhe +# +# Modified by: Your Name +# Github: @yourgithubusername +``` + +If the algorithm have been modified by multiple contributors, that should be included as follow. + +```py +# Contributed by: Carlos Abraham Hernandez +# Github: @abranhe +# +# Modifiers: +# Your Name, @yourgithubusername +# Your friend's name, @yourfriendongithub +``` + +### Adding Documentation + +Please make sure if you add an algorithm, you also add the required +documentation for it the `/docs` directory. + +Follow some of the examples already added. + +If you are modifying an algorithm make sure you add a benchmark using [Repl.it](https://repl.it/) for the maintainers to have it easy to review it. + + +#### Lastly and not less important: + +Make sure you start ⭐️ the project and follow [@abranhe](https://git.io/abranhe) diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000..9bfede2 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,21 @@ + + +This issue is: + + + +- [ ] A new Algorithm +- [ ] An update to an existing algorithm. +- [ ] An error found +- [ ] A proposal +- [ ] A question +- [ ] Other (Describe below*) + +**Description:** + + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b85077b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ + + +This pull request is: + + + +- [ ] A new Algorithm +- [ ] An update to an existing algorithm. +- [ ] An error fix +- [ ] Other (Describe below*) + +This pull request fixes: + + + +**Changes:** + + diff --git a/docs/readme.md b/docs/readme.md index 867bc1e..f755458 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -31,7 +31,9 @@ - Actively maintained - Because All Algorithms should easy to use in Python -Read the detailed documentation at [python.allalgorithms.com](https://python.allalgorithms.com) or see [Tree](#tree). +Read the detailed documentation at [python.allalgorithms.com](https://python.allalgorithms.com) or see [Tree](#tree). + +**Want to contribute?** [GET STARTED HERE](https://github.com/abranhe/python-lib/tree/master/.github/contributing.md) ## Install diff --git a/readme.md b/readme.md index cfbee77..1d5be4f 100644 --- a/readme.md +++ b/readme.md @@ -33,6 +33,8 @@ Read the detailed documentation at [python.allalgorithms.com](https://python.allalgorithms.com) or see the [`docs`](https://github.com/abranhe/python-lib/blob/master/docs) directory on Github. See [Tree](#tree). +**Want to contribute?** [GET STARTED HERE](https://github.com/abranhe/python-lib/tree/master/.github/contributing.md) + ## Install ``` From 4ea4898092d2283312d17a74677c9c76097ea437 Mon Sep 17 00:00:00 2001 From: Carlos Abraham Date: Wed, 10 Oct 2018 12:31:32 -0400 Subject: [PATCH 3/4] fix broken link --- .github/contributing.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/contributing.md b/.github/contributing.md index 28fa900..23022fe 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -5,11 +5,10 @@ ## See - [General Rules](#general-rules) -- [All ▲lgorithms Structure](#all-▲lgorithms-structure) -- [Adding new algorithms](adding-new-algorithms) +- [All ▲lgorithms Structure](#all-lgorithms-structure) +- [Adding new algorithms](#adding-new-algorithms) - [Style](#style) - [Adding Documentation](#adding-documentation) -- [Run it online](#run-it-online) ### General Rules From 5c7ec3e751c93ea7852eff673fe13b4fab842741 Mon Sep 17 00:00:00 2001 From: Carlos Abraham Date: Wed, 10 Oct 2018 12:34:44 -0400 Subject: [PATCH 4/4] =?UTF-8?q?fix=20broken=20link=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/contributing.md b/.github/contributing.md index 23022fe..963fbb0 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -5,7 +5,7 @@ ## See - [General Rules](#general-rules) -- [All ▲lgorithms Structure](#all-lgorithms-structure) +- [All ▲lgorithms Structure](#all-lgorithms-python-library-structure) - [Adding new algorithms](#adding-new-algorithms) - [Style](#style) - [Adding Documentation](#adding-documentation)