Skip to content

Commit 2e5cc9d

Browse files
committed
added CONTRIBUTING
1 parent 5421325 commit 2e5cc9d

2 files changed

Lines changed: 116 additions & 51 deletions

File tree

CONTRIBUTING.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Contributing to readchar
2+
3+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4+
5+
The following is a set of guidelines for contributing to this GitHub project. These are mostly guidelines, not rules. Use your best judgment, and feel
6+
free to propose changes to this document in a pull request.
7+
8+
## Opening an issue
9+
10+
If you want to open an issue about a problem or bug you encountered, simply go to the GitHub page and click _New issue_ in the _issues_ section. You
11+
will be presented with templates to use, choose a relevant one. (If no template fits, you can open a blank issue. But make sure you input all the
12+
appropriate information!)
13+
14+
Fill out the template. You should at least provide the following information:
15+
16+
- a short but exact description of your problem (screenshots often help)
17+
- steps on how to reproduce the problem
18+
- Information about your system:
19+
- your OS
20+
- your Python version and implementation
21+
- the version of readchar you use
22+
23+
## Opening a pull request
24+
25+
Follow these steps if you want to contribute code to the project:
26+
27+
1. Fork this Git repository and create your branch from `master`.
28+
29+
2. Check out the code to your local machine by following the steps in [Getting the code](#getting-the-code) and make your changes.
30+
31+
3. **Make sure the tests pass!!**
32+
33+
4. If you added to the source code, add tests for your new code.
34+
35+
5. Update the documentation, if necessary.
36+
37+
6. Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), if you have multiple changes, make sure your
38+
commits are atomic (single irreducible change that makes sense on its own)
39+
40+
7. Done, you can open a pull request.
41+
42+
## Getting the code
43+
44+
If you want to experiment with the code yourself, you can get started by following these steps.
45+
46+
1. Clone the repository.
47+
48+
```bash
49+
git clone https://github.com/magmax/python-readchar.git
50+
```
51+
52+
2. Create a virtual environment:
53+
54+
```bash
55+
python -m venv .venv
56+
```
57+
58+
3. Enter the virtual environment
59+
60+
on Linux systems:
61+
62+
```bash
63+
source .venv/bin/activate
64+
```
65+
66+
or for Windows systems:
67+
68+
```bash
69+
.venv\Scripts\activate
70+
```
71+
72+
4. Install dependencies
73+
74+
```bash
75+
pip install -r requirements.txt
76+
```
77+
78+
5. Install the local version of readchar (in edit mode, so it automatically reflects changes)
79+
80+
```bash
81+
pip install -e .
82+
```
83+
84+
### Run the tests!
85+
86+
Always make sure all tests pass before suggesting any changes! This will avoid invalid PR's.
87+
88+
The simplest way is to just run `make`. The provided makefile calls all tests for you.
89+
90+
```bash
91+
make
92+
```
93+
94+
If you don't have `make`, you could run all tests manually like this:
95+
96+
- run `pytest` (source-code testing)
97+
98+
```bash
99+
pytest
100+
```
101+
102+
- run `pre-commit` (linting and styling)
103+
104+
```bash
105+
pre-commit run -a
106+
```
107+
108+
- run `setup.py` (to test build process)
109+
110+
```bash
111+
python setup.py sdist bdist_wheel
112+
```

README.rst

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -117,58 +117,10 @@ Thank you!
117117
How to contribute
118118
=================
119119

120-
You can download the code, make some changes with their tests, and open a pull-request.
120+
You have an issue problem or found a bug? You have a great new idea or just want to fix a typo? Great :+1:. We are happy to accept your issue or pull
121+
request, but first, please read our `contribution guidelines <CONTRIBUTING_>`_. They will also tell you how to write code for this repo and
122+
how to properly prepare an issue or a pull request.
121123

122-
In order to develop and run the tests, follow these steps:
123-
124-
1. Clone the repository.
125-
126-
.. code:: bash
127-
128-
git clone https://github.com/magmax/python-readchar.git
129-
130-
2. Create a virtual environment:
131-
132-
.. code:: bash
133-
134-
python -m venv .venv
135-
136-
3. Enter the virtual environment
137-
138-
on Linux systems:
139-
140-
.. code:: bash
141-
142-
source .venv/bin/activate
143-
144-
or for Windows systems:
145-
146-
.. code:: bash
147-
148-
.venv\Scripts\activate
149-
150-
4. Install dependencies
151-
152-
.. code:: bash
153-
154-
pip install -r requirements.txt
155-
156-
5. Install the local version of readchar (in edit mode, so it automatically reflects changes)
157-
158-
.. code:: bash
159-
160-
pip install -e .
161-
162-
6. Run tests
163-
164-
.. code:: bash
165-
166-
make
167-
168-
(or run the commands used inside the Makefile manually, if you don't have/know :code:`make`)
169-
170-
171-
Please, **Execute the tests before any pull-request**. This will avoid invalid builds.
172124

173125

174126
------
@@ -201,4 +153,5 @@ Please, **Execute the tests before any pull-request**. This will avoid invalid b
201153
.. _GitHub: https://github.com/magmax/python-readchar
202154
.. _PyPi: https://pypi.python.org/pypi/readchar
203155
.. _LICENCE: LICENCE
156+
.. _CONTRIBUTING: https://github.com/magmax/python-readchar/blob/master/CONTRIBUTING.md
204157
.. _python-inquirer: https://github.com/magmax/python-inquirer

0 commit comments

Comments
 (0)