| 1 |
So you've started using `autoimport` and want to show your gratitude to the project, |
| 2 |
depending on your programming skills there are different ways to do so. |
| 3 |
|
| 4 |
# I don't know how to program |
| 5 |
|
| 6 |
There are several ways you can contribute: |
| 7 |
|
| 8 |
* [Open an issue](https://github.com/lyz-code/autoimport/issues/new) if you encounter |
| 9 |
any bug or to let us know if you want a new feature to be implemented. |
| 10 |
* Spread the word about the program. |
| 11 |
* Review the [documentation](https://lyz-code.github.io/autoimport) and try to improve |
| 12 |
it. |
| 13 |
|
| 14 |
# I know how to program in Python |
| 15 |
|
| 16 |
If you have some python knowledge there are some additional ways to contribute. |
| 17 |
We've ordered the [issues](https://github.com/lyz-code/autoimport/issues) in |
| 18 |
[milestones](https://github.com/lyz-code/autoimport/milestones), check the issues in |
| 19 |
the smaller one, as it's where we'll be spending most of our efforts. Try the |
| 20 |
[good first |
| 21 |
issues](https://github.com/lyz-code/autoimport/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), |
| 22 |
as they are expected to be easier to get into the project. |
| 23 |
|
| 24 |
We develop the program with |
| 25 |
[TDD](https://en.wikipedia.org/wiki/Test-driven_development), so we expect any |
| 26 |
contribution to have it's associated tests. We also try to maintain an updated |
| 27 |
[documentation](https://lyz-code.github.io/autoimport) of the project, so think if |
| 28 |
your contribution needs to update it. |
| 29 |
|
| 30 |
We know that the expected code quality is above average. Therefore it might |
| 31 |
be challenging to get the initial grasp of the project structure, know how to make the |
| 32 |
tests, update the documentation or use all the project technology stack. but please |
| 33 |
don't let this fact discourage you from contributing: |
| 34 |
|
| 35 |
* If you want to develop a new feature, explain how you'd like to do it in the related issue. |
| 36 |
* If you don't know how to test your code, do the pull request without the tests |
| 37 |
and we'll try to do them for you. |
| 38 |
|
| 39 |
# Issues |
| 40 |
|
| 41 |
Questions, feature requests and bug reports are all welcome as issues. |
| 42 |
**To report a security vulnerability, please see our [security |
| 43 |
policy](https://github.com/lyz-code/autoimport/security/policy) instead.** |
| 44 |
|
| 45 |
To make it as simple as possible for us to help you, please include the output |
| 46 |
of the following call in your issue: |
| 47 |
|
| 48 |
```bash |
| 49 |
python -c "import autoimport.version; print(autoimport.version.version_info())" |
| 50 |
``` |
| 51 |
|
| 52 |
or if you have `make` installed, you can use `make version`. |
| 53 |
|
| 54 |
Please try to always include the above unless you're unable to install `autoimport` or know it's not relevant to your question or |
| 55 |
feature request. |
| 56 |
|
| 57 |
# Pull Requests |
| 58 |
|
| 59 |
*autoimport* is released regularly so you should see your |
| 60 |
improvements release in a matter of days or weeks. |
| 61 |
|
| 62 |
!!! note |
| 63 |
Unless your change is trivial (typo, docs tweak etc.), please create an |
| 64 |
issue to discuss the change before creating a pull request. |
| 65 |
|
| 66 |
If you're looking for something to get your teeth into, check out the ["help |
| 67 |
wanted"](https://github.com/lyz-code/autoimport/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) |
| 68 |
label on github. |
| 69 |
|
| 70 |
# Development facilities |
| 71 |
|
| 72 |
To make contributing as easy and fast as possible, you'll want to run tests and |
| 73 |
linting locally. |
| 74 |
|
| 75 |
!!! note "" |
| 76 |
**tl;dr**: use `make format` to fix formatting, `make` to run tests and linting & `make docs` |
| 77 |
to build the docs. |
| 78 |
|
| 79 |
You'll need to have python 3.6, 3.7, or 3.8, virtualenv, git, and make installed. |
| 80 |
|
| 81 |
* Clone your fork and go into the repository directory: |
| 82 |
|
| 83 |
```bash |
| 84 |
git clone [email protected]:<your username>/autoimport.git |
| 85 |
cd autoimport |
| 86 |
``` |
| 87 |
|
| 88 |
* Set up the virtualenv for running tests: |
| 89 |
|
| 90 |
```bash |
| 91 |
virtualenv -p `which python3.7` env |
| 92 |
source env/bin/activate |
| 93 |
``` |
| 94 |
|
| 95 |
* Install autoimport, dependencies and configure the |
| 96 |
pre-commits: |
| 97 |
|
| 98 |
```bash |
| 99 |
make install |
| 100 |
``` |
| 101 |
|
| 102 |
* Checkout a new branch and make your changes: |
| 103 |
|
| 104 |
```bash |
| 105 |
git checkout -b my-new-feature-branch |
| 106 |
``` |
| 107 |
|
| 108 |
* Fix formatting and imports: autoimport uses |
| 109 |
[black](https://github.com/ambv/black) to enforce formatting and |
| 110 |
[isort](https://github.com/timothycrosley/isort) to fix imports. |
| 111 |
|
| 112 |
```bash |
| 113 |
make format |
| 114 |
``` |
| 115 |
|
| 116 |
* Run tests and linting: |
| 117 |
|
| 118 |
```bash |
| 119 |
make |
| 120 |
``` |
| 121 |
|
| 122 |
There are more sub-commands in Makefile like `test-code`, `test-examples`, |
| 123 |
`mypy` or `security` which you might want to use, but generally `make` |
| 124 |
should be all you need. |
| 125 |
|
| 126 |
If you need to pass specific arguments to pytest use the `ARGS` variable, |
| 127 |
for example `make test ARGS='-k test_markdownlint_passes'`. |
| 128 |
|
| 129 |
* Build documentation: If you have changed the documentation, make sure it |
| 130 |
builds the static site. Once built it will serve the documentation at |
| 131 |
`localhost:8000`: |
| 132 |
|
| 133 |
```bash |
| 134 |
make docs |
| 135 |
``` |
| 136 |
|
| 137 |
* Commit, push, and create your pull request. |
| 138 |
|
| 139 |
We'd love you to contribute to *autoimport*! |