|
| 1 | +Contributing to Rails Html Sanitizers |
| 2 | +===================== |
| 3 | + |
| 4 | +[](https://travis-ci.org/rails/rails-html-sanitizer) |
| 5 | + |
| 6 | +Rails Html Sanitizers is work of [many contributors](https://github.com/rails/rails-html-sanitizer/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/rails/rails-html-sanitizer/pulls), [propose features and discuss issues](https://github.com/rails/rails-html-sanitizer/issues). |
| 7 | + |
| 8 | +#### Fork the Project |
| 9 | + |
| 10 | +Fork the [project on Github](https://github.com/rails/rails-html-sanitizer) and check out your copy. |
| 11 | + |
| 12 | +``` |
| 13 | +git clone https://github.com/contributor/rails-html-sanitizer.git |
| 14 | +cd rails-html-sanitizer |
| 15 | +git remote add upstream https://github.com/rails/rails-html-sanitizer.git |
| 16 | +``` |
| 17 | + |
| 18 | +#### Create a Topic Branch |
| 19 | + |
| 20 | +Make sure your fork is up-to-date and create a topic branch for your feature or bug fix. |
| 21 | + |
| 22 | +``` |
| 23 | +git checkout master |
| 24 | +git pull upstream master |
| 25 | +git checkout -b my-feature-branch |
| 26 | +``` |
| 27 | + |
| 28 | +#### Bundle Install and Test |
| 29 | + |
| 30 | +Ensure that you can build the project and run tests. |
| 31 | + |
| 32 | +``` |
| 33 | +bundle install |
| 34 | +bundle exec rake test |
| 35 | +``` |
| 36 | + |
| 37 | +#### Write Tests |
| 38 | + |
| 39 | +Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [test](test). |
| 40 | + |
| 41 | +We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix. |
| 42 | + |
| 43 | +#### Write Code |
| 44 | + |
| 45 | +Implement your feature or bug fix. |
| 46 | + |
| 47 | +Make sure that `bundle exec rake test` completes without errors. |
| 48 | + |
| 49 | +#### Write Documentation |
| 50 | + |
| 51 | +Document any external behavior in the [README](README.md). |
| 52 | + |
| 53 | +#### Commit Changes |
| 54 | + |
| 55 | +Make sure git knows your name and email address: |
| 56 | + |
| 57 | +``` |
| 58 | +git config --global user.name "Your Name" |
| 59 | +git config --global user.email "[email protected]" |
| 60 | +``` |
| 61 | + |
| 62 | +Writing good commit logs is important. A commit log should describe what changed and why. |
| 63 | + |
| 64 | +``` |
| 65 | +git add ... |
| 66 | +git commit |
| 67 | +``` |
| 68 | + |
| 69 | +#### Push |
| 70 | + |
| 71 | +``` |
| 72 | +git push origin my-feature-branch |
| 73 | +``` |
| 74 | + |
| 75 | +#### Make a Pull Request |
| 76 | + |
| 77 | +Go to https://github.com/contributor/rails-html-sanitizer and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days. |
| 78 | + |
| 79 | +#### Rebase |
| 80 | + |
| 81 | +If you've been working on a change for a while, rebase with upstream/master. |
| 82 | + |
| 83 | +``` |
| 84 | +git fetch upstream |
| 85 | +git rebase upstream/master |
| 86 | +git push origin my-feature-branch -f |
| 87 | +``` |
| 88 | + |
| 89 | +#### Check on Your Pull Request |
| 90 | + |
| 91 | +Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above. |
| 92 | + |
| 93 | +#### Be Patient |
| 94 | + |
| 95 | +It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there! |
| 96 | + |
| 97 | +#### Thank You |
| 98 | + |
| 99 | +Please do know that we really appreciate and value your time and work. We love you, really. |
0 commit comments