Skip to content

Commit 5b640c6

Browse files
authored
Merge pull request #12 from craigthomas/contributing
Create CONTRIBUTING.md
2 parents ed3674d + c9125a6 commit 5b640c6

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed

CONTRIBUTING.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Contributing
2+
3+
First of all, thank you for considering making a contribution to the project! Below are some guidelines for contributing
4+
to the project. Please feel free to propose changes to the guidelines in a pull request if you feel something is missing
5+
or needs more clarity.
6+
7+
# Table of Contents
8+
9+
1. [How can I contribute?](#how-can-i-contribute)
10+
1. [Reporting bugs](#reporting-bugs)
11+
2. [Suggesting features](#suggesting-features)
12+
3. [Contributing code](#contributing-code)
13+
4. [Pull requests](#pull-requests)
14+
2. [Style guidelines](#style-guidelines)
15+
1. [Git commit messages](#git-commit-messages)
16+
2. [Code style](#code-style)
17+
18+
# How can I contribute?
19+
20+
There are several different way that you can contribute to the development of the project, each of which are most
21+
welcome.
22+
23+
## Reporting bugs
24+
25+
Bugs are reported through the [GitHub Issue](https://github.com/craigthomas/Chip8Python/issues) interface. Please check
26+
first to see if the bug you are reporting has already been reported. When reporting a bug, please take the time to
27+
describe the following details:
28+
29+
1. **Descriptive Title** - please ensure that the title to your issue is clear and descriptive of the problem.
30+
2. **Steps for Reproduction** - outline all the steps exactly that are required to reproduce the bug. For example,
31+
start by explaining how you started the program, which ROM you were running, and any other command line switches
32+
that were set, as well as what environment you are running in (e.g. Windows, Linux, MacOS, etc).
33+
3. **Describe the Bug Behaviour** - describe what happens with the emulator, and why you think that this behaviour
34+
represents a bug.
35+
4. **Describe Expected Behaviour** - describe what behaviour you believe should occur as a result of the steps
36+
that you took up to the point where the bug occurred.
37+
38+
Please feel free to provide additional context to help a developer track down the bug:
39+
40+
* **Can you reproduce the bug reliably or is it intermittent?** If it is intermittent, please try to explain what
41+
would normally provoke the bug, or under what conditions you saw it occur last time.
42+
* **Does it happen for any other ROMs?** It is helpful if you can try and pinpoint the buggy behaviour to a certain
43+
ROM or handful of ROMs.
44+
45+
## Suggesting features
46+
47+
When suggesting features or enhancements for the emulator, it is best to check out the open issues first to see whether
48+
or not such a feature is already under development. It is also worthwhile checking any open branches to see if the
49+
feature you are requesting is already in development. Finally, before submitting your suggestion, please ensure that
50+
the feature does not already exist by updating your local copy with the latest version from our `master` branch.
51+
52+
To submit a feature request, please open a new [GitHub Issue](https://github.com/craigthomas/Chip8Python/issues) and
53+
provide the following details:
54+
55+
1. **Descriptive Title** - please ensure that the title to your issue is clear and descriptive of the enhancement or
56+
functionality you wish to see.
57+
2. **Step by Step Description** - describe how the functionality of the system should occur with a step-by-step breakdown
58+
of how you expect the emulator to run. For example, if you wish to have a new debugging key added, describe how the
59+
emulator execution flow will change when the key is pressed.
60+
3. **Use Animated GIFs** - if you are feeling ambitious, or if you feel words do not adequately describe the proposed
61+
functionality, please submit an animated GIF, or a drawing of the new proposed functionality.
62+
4. **Explain Usefulness** - please take a brief moment to describe why you feel the new functionality would be useful.
63+
64+
## Contributing code
65+
66+
Code contributions should be made using the following process:
67+
68+
1. **Fork the Repository** - create a fork of the respository using the Fork button in GitHub.
69+
2. **Make Code Changes** - using your forked repository, make changes to the code as you see fit. We recommend creating a
70+
branch for your code changes so that you can easily update your own local master without creating too many merge
71+
conflicts.
72+
3. **Submit Pull Request** - when you are ready, submit a pull request back to the `master` branch of this repository.
73+
The pull request will be reviewed, and you may be asked questions about the changes you are proposing. In some cases,
74+
we may ask you to make adjustments to the code to fit in with the overall style and behavioiur of the rest of the
75+
project.
76+
77+
There are also some additional guidelines you should follow when coding up enhancements or bugfixes:
78+
79+
1. Please reference any open issues that the Pull Request will close by writing `Closes #` with the issue number (e.g. `Closes #12`).
80+
2. New functionality should have unit and/or integration tests that exercise at least 50% of the code that was added.
81+
3. For bug fixes, please ensure that you have a test that covers buggy input conditions so that we reduce the likelihood of
82+
a regression in the future.
83+
4. Please ensure all functions have appropriately descriptive docstrings, as well as descriptions for inputs and outputs.
84+
85+
If you don't know where to start, then take a look for issues marked `beginner` or `help-wanted`. Any issues with the `beginner` tag
86+
will generally only require one or two lines of code to fix. Issues marked `help-wanted` may be more complex than beginner issues,
87+
but should be scoped in such a way to ease you in to the codebase.
88+
89+
## Pull requests
90+
91+
Please follow all the instructions as mentioned in the Pull Request template. When you submit your pull request, please ensure that
92+
all of the required [status checks](https://help.github.com/articles/about-status-checks/) have succeeded. If the status checks
93+
are failing, and you believe that the failures are not related to your change, please leave a description within the pull request why
94+
you believe the failures are not related to your code changes. A maintainer will re-run the checks manually, and investigate further.
95+
96+
A maintainer will review your pull request, and may ask you to perform some additional design work, tests, or other changes prior
97+
to approving and merging your code.
98+
99+
# Style guidelines
100+
101+
In general, there are two sets of style guidelines that we ask contributors to follow.
102+
103+
## Git commit messages
104+
105+
* For large changesets, provide detailed descriptions in your commit logs regarding what was changed. The git commit message should
106+
look like this:
107+
108+
```
109+
$ git commit -m "A brief title / description of the commit
110+
>
111+
> A more descriptive set of paragraphs about the changeset."
112+
```
113+
114+
* Limit your first line to 70 characters.
115+
* If you are just changing documentation, please include `[ci skip]` in the commit title.
116+
* Please reference issue numbers and pull requests in the commit description where applicable using `#` and the issue number (e.g.
117+
`#24`).
118+
119+
## Code style
120+
121+
* Please follow the [PEP 8 Style Guidelines](https://www.python.org/dev/peps/pep-0008/) for any code that you wish to contribute.
122+
* When submitting code, we strongly suggesting running [pylint](https://www.pylint.org/) on any file that you changed to see
123+
if there are any problems introduced to the codebase.
124+
* Please ensure any docstrings describe the functionality of the functions, including what the input and output parameters
125+
do.
126+
* Please do not use docstrings on unit test functions (these get displayed by the test runner instead of the name of the function).
127+
Instead, use descriptive names for the functions (e.g. `test_cpu_raises_nmi_when_overflow_occurs`).
128+
* When importing, we prefer the following layout:
129+
* Full package imports at the top (e.g. `import os`).
130+
* Selective function imports using `from` next (e.g. `from os import chdir`).
131+
* Local imports last.

0 commit comments

Comments
 (0)