|
| 1 | +# Contributing to iText 7 Community |
| 2 | + |
| 3 | +We'd love for you to contribute to our source code and to make **iText 7 Community** even better than it is |
| 4 | +today! Here are the guidelines we'd like you to follow: |
| 5 | + |
| 6 | + - [Question or Problem?](#question) |
| 7 | + - [Issues and Bugs](#issue) |
| 8 | + - [New Features](#feature) |
| 9 | + - [Submission Guidelines](#submit) |
| 10 | + - [Coding Rules](#rules) |
| 11 | + - [Commit Message Guidelines](#commit) |
| 12 | + - [Signing the iCLA](#cla) |
| 13 | + - [Contributor Code of Conduct](#coc) |
| 14 | + |
| 15 | + |
| 16 | +## <a name="question">Got a Question or Problem?</a> |
| 17 | + |
| 18 | +If you have questions about how to use **iText 7 Community**, please direct these to [Stack Overflow][stackoverflow]. |
| 19 | + |
| 20 | +If you are a customer with a [support agreement][support], you also have direct access to our JIRA and our developers. |
| 21 | + |
| 22 | + |
| 23 | +## <a name="issue">Found an Issue?</a> |
| 24 | +If you find a bug in the source code or a mistake in the documentation, you can help us by |
| 25 | +submitting a [Pull Request][pull] with a fix. |
| 26 | + |
| 27 | +**Please see the [Submission Guidelines](#submit) below**. |
| 28 | + |
| 29 | + |
| 30 | +## <a name="feature">Want to implement a Feature?</a> |
| 31 | +If you would like to implement a new feature then consider what kind of change it is: |
| 32 | + |
| 33 | +* **Major Changes** that you wish to contribute to the project should be discussed first so that we can better |
| 34 | +coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully |
| 35 | +accepted into the project. Contact us at [[email protected]](mailto:[email protected]). |
| 36 | +* **Small Changes** can be crafted and submitted to the [GitHub Repository][github] as a [Pull Request][pull]. |
| 37 | + |
| 38 | + |
| 39 | +## <a name="submit">Submission Guidelines</a> |
| 40 | + |
| 41 | +### Submitting a Question or an Issue |
| 42 | +Before you submit your question or issue, search [Stack Overflow][stackoverflow], maybe your question was already answered. |
| 43 | + |
| 44 | +If your issue appears to be a bug, and hasn't been reported, ask a question on [Stack Overflow][stackoverflow] to verify that is indeed a bug and not a mistake in your own code. |
| 45 | +Help us to maximize the effort we can spend fixing issues and adding new |
| 46 | +features, by not reporting duplicate issues. Providing the following information will increase the |
| 47 | +chances of your issue being dealt with quickly: |
| 48 | + |
| 49 | +* **[How to ask good questions][good-questions]** |
| 50 | +* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps |
| 51 | +* **Motivation for or Use Case** - explain why this is a bug for you |
| 52 | +* **iText Version(s)** - is it a regression? |
| 53 | +* **Operating System** - is this a problem on Windows or Linux, maybe on Mac? |
| 54 | +* **Reproduce the Error** - provide a [Short, Self Contained, Correct (Compilable), Example][sscce], also known as a [Minimal, Complete, and Verifiable example][mcve]. |
| 55 | +* **Related Issues** - has a similar issue been reported before? |
| 56 | +* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be |
| 57 | + causing the problem (line of code or commit) |
| 58 | +* **Tag the question** - add the tag `itext7` to your question so we can find it. |
| 59 | + |
| 60 | +**If you get help, help others. Good karma rulez!** |
| 61 | + |
| 62 | + |
| 63 | +### Submitting a Pull Request |
| 64 | +Before you submit your pull request consider the following guidelines: |
| 65 | + |
| 66 | +* Search [GitHub][pull] for an open or closed Pull Request |
| 67 | + that relates to your submission. You don't want to duplicate effort. |
| 68 | +* Verify that your proposed change hasn't already been addressed in the develop branch. |
| 69 | +* Don't send a separate pull request for every single file you change. |
| 70 | +* Please sign the [iText Contributor License Agreement (iCLA)](#cla) before sending pull |
| 71 | + requests. We cannot accept code without this agreement. |
| 72 | +* Fork the iText repository on GitHub. |
| 73 | +* Clone your iText fork to your local machine. |
| 74 | +* Make your changes, **including appropriate test cases**. |
| 75 | +* Follow our [Coding Rules](#rules). |
| 76 | +* Commit your changes using a descriptive commit message that follows our |
| 77 | + [commit message conventions](#commit-message-format). |
| 78 | +* Now would be a good time to fix up your commits (if you want or need to) with `git rebase --interactive`. |
| 79 | +* Build your changes locally to ensure all the tests pass. |
| 80 | +* Push your changes to your GitHub account. |
| 81 | +* Create a pull request in GitHub. |
| 82 | +"Head fork" should be your repository, and the "base fork" should be the iText7 official repository. |
| 83 | +* If we suggest changes then: |
| 84 | + * Make the required updates. |
| 85 | + * Fix up your commits if needed, with an interactive rebase. |
| 86 | + * Re-run the tests and make sure that they are still passing. |
| 87 | + * Force push to your GitHub repository. This will update your Pull Request. |
| 88 | + |
| 89 | +That's it! Thank you for your contribution! |
| 90 | + |
| 91 | +#### After your pull request is merged |
| 92 | + |
| 93 | +After your pull request is merged, you can safely delete your fork and pull the changes |
| 94 | +from the main (upstream) repository. |
| 95 | + |
| 96 | + |
| 97 | +## <a name="rules">Coding Rules</a> |
| 98 | +To ensure consistency throughout the source code, keep these rules in mind as you are working: |
| 99 | + |
| 100 | +* We develop in Java first, and then port to .NET, so code submissions in Java are preferred. |
| 101 | + Nevertheless this shouldn't stop you from making a good pull request to the .NET port. |
| 102 | +* All features or bug fixes **must be tested** by one or more unit tests. |
| 103 | +* All public API methods **must be documented** with JavaDoc. To see how we document our APIs, please check |
| 104 | + out the existing [javadocs][javadocs]. |
| 105 | +* We follow the rules contained in |
| 106 | + [Oracle's Code Conventions for the Java Programming Language][java-style-guide], with these additions: |
| 107 | + * Wrap all code at **100 characters**. |
| 108 | + |
| 109 | + |
| 110 | +## <a name="commit">Git Commit Guidelines</a> |
| 111 | + |
| 112 | +We have guidelines on how our git commit messages should be formatted. This leads to **more |
| 113 | +readable messages** that are easy to follow when looking through the **project history**. But also, |
| 114 | +we use the git commit messages to **generate the iText 7 Community change log**. |
| 115 | + |
| 116 | +These guidelines were taken from Chris Beams' blog post [How to Write a Git Commit Message][git-commit]. |
| 117 | + |
| 118 | +### Commit Message Format |
| 119 | +Each commit message consists of a **subject**, a **body** and a **footer**: |
| 120 | + |
| 121 | +``` |
| 122 | +<subject> |
| 123 | +<BLANK LINE> |
| 124 | +<body> |
| 125 | +<BLANK LINE> |
| 126 | +<footer> |
| 127 | +``` |
| 128 | + |
| 129 | +Any line of the commit message should not be longer 72 characters! This allows the message to be easier |
| 130 | +to read on GitHub as well as in various git tools. |
| 131 | + |
| 132 | +### Subject |
| 133 | +The subject contains succinct description of the change: |
| 134 | + |
| 135 | +* [Separate subject from body with a blank line][git-commit-separate] |
| 136 | +* [Limit the subject line to 50 characters][git-commit-limit-50] |
| 137 | +* [Capitalize the subject line][git-commit-capitalize] |
| 138 | +* [Do not end the subject line with a period][git-commit-end] |
| 139 | +* [Use the imperative mood in the subject line][git-commit-imperative] |
| 140 | + |
| 141 | +### Body |
| 142 | +* [Wrap the body at 72 characters][git-commit-wrap-72] |
| 143 | +* [Use the body to explain _what_ and _why_ vs. _how_][git-commit-why-not-how] |
| 144 | + |
| 145 | +### Footer |
| 146 | +The footer contains any information about **Breaking Changes** and is also the place to |
| 147 | +reference JIRA or GitHub issues that this commit **Closes**. |
| 148 | + |
| 149 | + |
| 150 | +## <a name="cla">Signing the iCLA</a> |
| 151 | + |
| 152 | +Please sign the [**iText Contributor License Agreement (iCLA)**][cla] before sending pull requests. For any code changes to be accepted, the iCLA must be signed. It's a quick process, we promise! |
| 153 | + |
| 154 | +We'll need you to [(digitally) sign and then email, fax or mail the form][cla]. |
| 155 | + |
| 156 | + |
| 157 | +## <a name="coc">Contributor Code of Conduct</a> |
| 158 | +Please note that this project is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms. |
| 159 | + |
| 160 | +We use the [Stack Exchange][stackoverflow] network for free support and [GitHub][github] for code hosting. By using these services, you agree to abide by their terms: |
| 161 | + |
| 162 | +* StackExchange: [http://stackexchange.com/legal](http://stackexchange.com/legal) |
| 163 | +* Github: [https://help.github.com/articles/github-terms-of-service/](https://help.github.com/articles/github-terms-of-service/) |
| 164 | + |
| 165 | +[cla]: https://itextpdf.com/en/how-buy/legal/itext-contributor-license-agreement |
| 166 | +[coc]: CODE_OF_CONDUCT.md |
| 167 | +[github]: https://github.com/itext/i7j-pdfocr |
| 168 | +[java-style-guide]: https://www.oracle.com/technetwork/java/codeconvtoc-136057.html |
| 169 | +[javadocs]: https://itextpdf.com/api |
| 170 | +[pull]: https://github.com/itext/i7j-pdfocr/pulls |
| 171 | +[sscce]: http://sscce.org/ |
| 172 | +[stackoverflow]: https://stackoverflow.com/questions/tagged/itext7 |
| 173 | +[good-questions]: https://stackoverflow.com/help/how-to-ask |
| 174 | +[mcve]: https://stackoverflow.com/help/mcve |
| 175 | +[support]: https://itextpdf.com/support |
| 176 | +[git-commit]: https://chris.beams.io/posts/git-commit/ |
| 177 | +[git-commit-separate]: https://chris.beams.io/posts/git-commit/#separate |
| 178 | +[git-commit-limit-50]: https://chris.beams.io/posts/git-commit/#limit-50 |
| 179 | +[git-commit-capitalize]: https://chris.beams.io/posts/git-commit/#capitalize |
| 180 | +[git-commit-end]: https://chris.beams.io/posts/git-commit/#end |
| 181 | +[git-commit-imperative]: https://chris.beams.io/posts/git-commit/#imperative |
| 182 | +[git-commit-wrap-72]: https://chris.beams.io/posts/git-commit/#wrap-72 |
| 183 | +[git-commit-why-not-how]: https://chris.beams.io/posts/git-commit/#why-not-how |
0 commit comments