|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +We are always after more contributors and suggestions. |
| 4 | + |
| 5 | +## Suggestions or issues with metacpan... |
| 6 | + |
| 7 | +#### Does it relate to our API (backend)... ? |
| 8 | + |
| 9 | + 1. Please check the [previously reported API issues](https://github.com/CPAN-API/cpan-api/issues) |
| 10 | + 2. Please check the [Wishlist](https://github.com/CPAN-API/cpan-api/wiki/Wishlist). If you can't find it already there: |
| 11 | + * If it's a wishlist idea, please edit the [wiki](https://github.com/CPAN-API/cpan-api/wiki/Wishlist) (add a 'wishlist_MYIDEA' page if you need more space!) |
| 12 | + * If it's an actual bug [create a new issue](https://github.com/CPAN-API/cpan-api/issues/new) |
| 13 | + |
| 14 | +#### If you are not sure, or it is related to https://metacpan.org/ front end: |
| 15 | + |
| 16 | + 1. Please check the [previously reported Web issues](https://github.com/CPAN-API/metacpan-web/issues) |
| 17 | + 2. Please check the [Wishlist](https://github.com/CPAN-API/cpan-api/wiki/Wishlist). If you can't find it already there: |
| 18 | + * If it's a wishlist idea, please edit the [wiki](https://github.com/CPAN-API/cpan-api/wiki/Wishlist) (add a 'wishlist_MYIDEA' page if you need more space!) |
| 19 | + * If it's an actual bug [create a new issue](https://github.com/CPAN-API/metacpan-web/issues/new) |
| 20 | + |
| 21 | +## Contributing code |
| 22 | + |
| 23 | +Come talk to us on IRC (see below), or send a pull request and we'll respond |
| 24 | +there. If you implement a new feature, please add a note about it to the |
| 25 | +News.md file at the top level of metacpan-web so that it will appear in our |
| 26 | +news feed. |
| 27 | + |
| 28 | +If you aren't using the VM, remember to enable the pre-commit hook before you start working. |
| 29 | + |
| 30 | + sh git/setup.sh |
| 31 | + |
| 32 | +These links will get you going quickly: |
| 33 | + |
| 34 | + * [Using our developer VM](https://github.com/CPAN-API/metacpan-developer) to get you going in minutes (depending on bandwidth) |
| 35 | + * [Front end bug list](https://github.com/CPAN-API/metacpan-web/issues) |
| 36 | + * [API (back end) bug list](https://github.com/CPAN-API/cpan-api/issues) |
| 37 | + * [Wishlist](https://github.com/CPAN-API/cpan-api/wiki/Wishlist) - things that probably need doing |
| 38 | + |
| 39 | +# Git workflow |
| 40 | + |
| 41 | +We try to keep a clean git history, so if it all possible, please rebase to get |
| 42 | +the latest changes from master _before_ submitting a pull request. You'll only |
| 43 | +need to do the first command (git remote add) once in your local checkout. |
| 44 | + |
| 45 | + git remote add upstream https://github.com/CPAN-API/metacpan-web.git |
| 46 | + git pull --rebase upstream master |
| 47 | + |
| 48 | +If you are comfortable rebasing, it is also helpful to squash or delete commits |
| 49 | +which are no longer relevant to your branch before submitting your work. |
| 50 | + |
| 51 | + git rebase -i master |
| 52 | + |
| 53 | +If you are not comfortable with rebasing, but want to use it, check out the steps |
| 54 | +from [here](https://help.github.com/articles/using-git-rebase/). |
| 55 | + |
| 56 | +# Coding conventions |
| 57 | + |
| 58 | +Please try to follow the conventions already been used in the code base. This |
| 59 | +will generally be the right thing to do. Our standards are improving, so even |
| 60 | +if you do follow what you see, we may ask you to make some changes, but that is |
| 61 | +a good thing. We are trying to keep things tidy. |
| 62 | + |
| 63 | +If you are using the [developer VM](https://github.com/CPAN-API/metacpan-developer) you can run: |
| 64 | + |
| 65 | +```sh |
| 66 | +/home/vagrant/carton/metacpan-web/bin/tidyall |
| 67 | +``` |
| 68 | + |
| 69 | +## Perl Best Practices |
| 70 | + |
| 71 | +In general, the concepts discussed in "Perl Best Practices" are a good starting |
| 72 | +point. Use autodie where possible and MetaCPAN::Web::Types when creating new |
| 73 | +Moose attributes. Many of the other standards will be enforced by Perl::Critic. |
| 74 | + |
| 75 | +## Clear > Concise |
| 76 | + |
| 77 | +Take pains to use variable names which are easy to understand and to write |
| 78 | +readable code. We value readable code over concise code. Use singular nouns |
| 79 | +for class names. Use verbs for method names. |
| 80 | + |
| 81 | +## Try::Tiny > eval { ... } |
| 82 | + |
| 83 | +You will see many eval statements in the code. We would like to standardize on |
| 84 | +Try::Tiny, so feel free to swap out any eval with a Try::Tiny and use Try::Tiny |
| 85 | +in all new code. |
| 86 | + |
| 87 | +## Prefer single quotes |
| 88 | + |
| 89 | +Always use single quotes in cases where there is no variable interpolation. If |
| 90 | +there is a single quote in the quoted item, use curly quotes. |
| 91 | + |
| 92 | +q{Isn't this a lovely day}; |
| 93 | + |
| 94 | +## Include a test (or more!) |
| 95 | + |
| 96 | +Any time when a pull request includes a test, it makes it easier for us to |
| 97 | +review and accept, so please do test your changes whenever possible. If your |
| 98 | +pull request includes visual changes, please include a before and after screen |
| 99 | +shot, so that we can better understand the problem you're trying to solve. |
| 100 | + |
| 101 | +## Dependencies |
| 102 | + |
| 103 | +Introducing new dependencies is fine, if they solve a specific problem which |
| 104 | +current dependencies cannot address. If we prefer a different module to be used, |
| 105 | +we'll let you know. |
| 106 | + |
| 107 | +## It's OK to be controversial |
| 108 | + |
| 109 | +If a pull request contains any controversial changes, we'll likely wait for some |
| 110 | +feedback from several developers before a merge. If you think your changes may |
| 111 | +be controversial, feel free to discuss them in a Github issue before starting to |
| 112 | +write any code. |
| 113 | + |
| 114 | +## Travis is your friend |
| 115 | + |
| 116 | +We use Travis to test all code changes. After submitting your pull request, |
| 117 | +remember to check back to see whether Travis has come back with any test |
| 118 | +failures. We do get some false negatives. If your pull request failed for |
| 119 | +reasons unrelated to your changes, we may still be able to merge your work. |
| 120 | + |
| 121 | +# Additional Resources |
| 122 | + |
| 123 | + * [\#metacpan](http://widget01.mibbit.com/?autoConnect=true&server=irc.perl.org&channel=%23metacpan&nick=) IRC channel on irc.perl.org |
| 124 | + |
| 125 | +# Current Policies |
| 126 | + |
| 127 | +### What is indexed? |
| 128 | + |
| 129 | + * Perl distributions which contain Perl packages. |
| 130 | + |
| 131 | +### When are issues closed? |
| 132 | + |
| 133 | +We want to keep the issue list manageable, so we can focus on what actually |
| 134 | +needs fixing. If you feel an issue needs opening again, please add a comment |
| 135 | +explaining why it needs re-opening and we'll look at it again. |
| 136 | + |
| 137 | + * Issues will be closed and moved to [Wishlist](https://github.com/CPAN-API/cpan-api/wiki/Wishlist) if they are not actual bugs |
| 138 | + * Issues we think we have addressed will be closed |
| 139 | + * Issues we are not going to take any further action on without more information will be closed |
0 commit comments