-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Contributing guidelines | ||
|
||
## Pull Request Checklist | ||
|
||
Before sending your pull requests, make sure you followed this list. | ||
|
||
- Read [contributing guidelines](CONTRIBUTING.md). | ||
- Read [Code of Conduct](CODE_OF_CONDUCT.md). | ||
- Check if my changes are consistent with the [guidelines](https://github.com/zurutech/ashpy/blob/master/CONTRIBUTING.md#general-guidelines-and-philosophy-for-contribution). | ||
- Changes are consistent with the [Coding Style](https://github.com/zurutech/ashpy/blob/master/CONTRIBUTING.md#python-coding-style). | ||
- Run [Tests](https://github.com/zurutech/ashpy/blob/master/CONTRIBUTING.md#running-tests). | ||
|
||
## How to become a contributor and submit your own code | ||
|
||
### Contributing code | ||
|
||
If you have improvements to AshPy, send us your pull requests! For those | ||
just getting started, please refer to [this](https://github.com/zurutech/ashpy/blob/master/.github/pull_request_template.md) pull request template. | ||
|
||
AshPy team members will be assigned to review your pull requests. Once the | ||
pull requests are approved and pass all the tests, your pull request will | ||
be merged into the official codebase. | ||
|
||
If you want to contribute, start working through the AshPy codebase, | ||
navigate to the | ||
[Github "issues" tab](https://github.com/zurutech/ashpy/issues) and start | ||
looking through interesting issues. | ||
|
||
### Contribution guidelines and standards | ||
|
||
Before sending your pull request for | ||
[review](https://github.com/zurutech/ashpy/pulls), | ||
make sure your changes are consistent with the guidelines and follow the | ||
AshPy coding style. | ||
|
||
#### General guidelines and philosophy for contribution | ||
|
||
* Include unit tests when you contribute new features, as they help to a) | ||
prove that your code works correctly, and b) guard against future breaking | ||
changes to lower the maintenance cost. | ||
* Bug fixes also generally require unit tests, because the presence of bugs | ||
usually indicates insufficient test coverage. | ||
* When you contribute a new feature to AshPy, the maintenance burden is | ||
(by default) transferred to the AshPy team. This means that the benefit | ||
of the contribution must be compared against the cost of maintaining the | ||
feature. | ||
|
||
#### License | ||
|
||
We'd love to accept your patches! Before we can take them, you need to understand | ||
that the code you provide will be included with the Apache License. | ||
|
||
You can see an example of the licence [here](https://github.com/zurutech/ashpy/blob/master/LICENSE). | ||
|
||
Please, put the following lincense header in your files. | ||
|
||
``` | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
``` | ||
|
||
#### Python coding style | ||
|
||
Changes to AshPy Python code should conform to | ||
[Google Python Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md) | ||
|
||
Use `pylint` to check your Python changes. To install `pylint`: | ||
|
||
```bash | ||
pip install pylint | ||
``` | ||
|
||
To check a file with `pylint`: | ||
|
||
```bash | ||
pylint --rcfile=/tmp/pylintrc myfile.py | ||
``` | ||
|
||
#### Running tests | ||
|
||
In order to run the doctests first you need to install the `pytest-sphinx` package and `pytest-cov` package: | ||
|
||
```bash | ||
pip --no-cache-dir install --upgrade git+https://github.com/thisch/pytest-sphinx.git pytest | ||
pip install pytest-cov | ||
``` | ||
|
||
Then you can run tests with coverage statistics with: | ||
|
||
```bash | ||
pytest -x -s -vvv --doctest-modules ashpy --cov=ashpy | ||
``` | ||
|
||
## Attribution | ||
This Contributing file is adapted from the TensorFlow Contributing available at https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md |