|
| 1 | +# Contributing to Cryptator |
| 2 | + |
| 3 | +The Cryptator team encourages community feedback and contributions. |
| 4 | +Thank you for your interest in making Dux Machina better! There are several ways you can get involved. |
| 5 | + |
| 6 | +If you are looking for a good way to contribute to the project, please: |
| 7 | + |
| 8 | +* have a look at the [available issue templates](https://github.com/arnaud-m/cryptator/issues/new/choose) |
| 9 | +and checkout the [examples of good first issues](https://github.com/arnaud-m/cryptator/contribute) |
| 10 | +(or [click here](https://github.com/arnaud-m/cryptator/labels/good%20first%20issue)). |
| 11 | + |
| 12 | +* look through the [issues that need help](https://github.com/arnaud-m/cryptator/labels/help%20wanted). |
| 13 | + |
| 14 | +* take a look at a [Pull Request template](PULL_REQUEST_TEMPLATE.md) to get yourself |
| 15 | +started. |
| 16 | + |
| 17 | +## Reporting issues and suggesting new features |
| 18 | + |
| 19 | +If you find that the project is not working properly, please file a report using |
| 20 | +the [Bug Report template](https://github.com/arnaud-m/cryptator/issues/new?assignees=&labels=bug&template=bug_report.md&title=[BUG]). |
| 21 | +Should the template provided not suit your needs, feel free to make a |
| 22 | +[custom Bug Report](https://github.com/arnaud-m/cryptator/issues/new/choose), |
| 23 | +but please label it accordingly. |
| 24 | + |
| 25 | +We are happy to hear your ideas for how to further improve cryptator, |
| 26 | +ensuring it suits your needs. Check the [Issues](https://github.com/arnaud-m/cryptator/issues) |
| 27 | +and see if others have submitted similar feedback. You can upvote existing feedback |
| 28 | +(using the thumbs up reaction/by commenting) or [submit a new suggestion](https://github.com/arnaud-m/cryptator/labels/feature). |
| 29 | + |
| 30 | +We always look at upvoted items in [Issues](https://github.com/arnaud-m/cryptator/issues) |
| 31 | +when we decide what to work on next. We read the comments and we look forward to |
| 32 | +hearing your input. |
| 33 | + |
| 34 | +## Finding issues you can help with |
| 35 | + |
| 36 | +Looking for something to work on? |
| 37 | +Issues marked [`good first issue`](https://github.com/arnaud-m/cryptator/labels/good%20first%20issue) |
| 38 | +are a good place to start. |
| 39 | + |
| 40 | +You can also check the [`help wanted`](https://github.com/arnaud-m/cryptator/labels/help%20wanted) |
| 41 | +tag to find other issues to help with. If you're interested in working on a fix, |
| 42 | +leave a comment to let everyone know and to help avoid duplicated effort from others. |
| 43 | + |
| 44 | +## Contributions we accept |
| 45 | + |
| 46 | +We highly appreciate any contributions that help us improve the end product, with |
| 47 | +a high emphasis being put on any bug fixes you can manage to create and direct |
| 48 | +improvements which address the top issues reported by Calculator users. Some general |
| 49 | +guidelines: |
| 50 | + |
| 51 | +### DOs |
| 52 | + |
| 53 | +* **DO** create one pull request per Issue, and ensure that the Issue is linked |
| 54 | +in the pull request. You can follow the [Pull Request Template](PULL_REQUEST_TEMPLATE.md) |
| 55 | +for this. |
| 56 | + |
| 57 | +* **DO** follow our [Coding and Style](#style-guidelines) guidelines, and keep code |
| 58 | +changes as small as possible. |
| 59 | + |
| 60 | +* **DO** include corresponding tests whenever possible. |
| 61 | + |
| 62 | +* **DO** check for additional occurrences of the same problem in other parts of the |
| 63 | +codebase before submitting your PR. |
| 64 | + |
| 65 | +* **DO** link the issue you are addressing in the pull request. |
| 66 | + |
| 67 | +* **DO** write a good description for your pull request. More detail is better. |
| 68 | +Describe *why* the change is being made and *why* you have chosen a particular solution. |
| 69 | +Describe any manual testing you performed to validate your change. |
| 70 | + |
| 71 | +### DO NOTs |
| 72 | + |
| 73 | +* **DO NOT** merge multiple changes into one PR unless they have the same root cause. |
| 74 | +* **DO NOT** merge directly into the master branch. |
| 75 | + |
| 76 | +> Submitting a pull request for an approved Issue is not a guarantee it will be approved. |
| 77 | +> The change must meet our high bar for code quality, architecture and performance. |
| 78 | +
|
| 79 | +## Making changes to the code |
| 80 | + |
| 81 | +### Preparing your development environment |
| 82 | + |
| 83 | +To learn how to build the code and run tests, follow the instructions in the [README](README.md). |
| 84 | + |
| 85 | +### Style guidelines |
| 86 | + |
| 87 | +The code in this project uses several different coding styles, depending on the |
| 88 | +age and history of the code. Please attempt to match the style of surrounding |
| 89 | +code as much as possible. |
| 90 | + |
| 91 | +<!-- |
| 92 | +In new components, prefer the patterns described in the |
| 93 | +[C++ core guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines). |
| 94 | +--> |
| 95 | +### Code formatting |
| 96 | + |
| 97 | + |
| 98 | +The code follows eclipse convention with the exception of spaces for tab. |
| 99 | + |
| 100 | +#### Eclipse configuration |
| 101 | + |
| 102 | +To configure eclipse, open the preferences and follow the instructions. |
| 103 | + |
| 104 | +- General -> Editors -> Text Editors: check 'insert spaces for tab' |
| 105 | +- Java -> Formater; new style 'Eclipse [modified]' |
| 106 | + - Indentation -> Tab policy: select 'Spaces only' |
| 107 | + - Whitespace -> Arrays -> Array Initializer: uncheck 'After opening brace' and 'Before closing brace' |
| 108 | + - Whitespace -> Declarations -> Constructors -> unchceck 'Before opening parenthesis'. |
| 109 | + - New Lines: check 'At end of file' |
| 110 | +- Java -> Code Style -> Clean Up: new style 'Eclipse [modified]' |
| 111 | + - Check always 'use block in if/while/do statements' |
| 112 | + - Check always 'use parentheses in expressions' |
| 113 | + - Unecessary code : check 'Avoid double negation' and 'Remove redundant modifiers' |
| 114 | +- Java -> Editor -> Save Action: check 'Perform the selected actions on save' and 'Format source code' |
| 115 | +- Checkstyle: new style Sun Checks [modified]' |
| 116 | + - SizeViolations -> LineLength : set max to 120 |
| 117 | + - Workaround for potential error message: 'Checkstyle execution failed due to an internal error. Please check error log for details' |
| 118 | + - Remove BOTH modules "SuppressionXpathFilter" and "SuppressionFilter" from the configuration |
| 119 | + |
| 120 | +<!-- |
| 121 | +- Right-click on your project in the Package view and select Checkstyle -> Create Formatter-Profile. The following files will be created in you project: |
| 122 | + - my-project-cs-cleanup.xml |
| 123 | + - my-project-cs-formatter.xml |
| 124 | +- Add the generated my-project-cs-formatter.xml as a formatter: Windows -> Preferences -> Java -> Code Style -> Formatter -> Import |
| 125 | +--> |
| 126 | + |
| 127 | +### Testing |
| 128 | + |
| 129 | +Your change should include tests to verify new functionality wherever possible. |
| 130 | +Code should be structured so that it can be unit tested independently of the UI. |
| 131 | +Manual test cases should be used where automated testing is not feasible. |
| 132 | + |
| 133 | +### Git workflow |
| 134 | + |
| 135 | +The core principle of the project, when it comes to Git workflows is that the |
| 136 | +`master` branch should always be in a healthy state which is ready for release. |
| 137 | +Every commit on master should be deployable on push. To ensure this, pull request |
| 138 | +**must not** be made directly on master. **Each change** should either be made in |
| 139 | +the **development branch** (named a variation of development, i.e. `dev`) or in a |
| 140 | +separate branch, named as a short summary of the change. |
| 141 | + |
| 142 | +If your change is complex, please clean up the branch history before submitting a |
| 143 | +pull request. You can use [git rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) |
| 144 | +to group your changes into a small number of commits which we can review one at a |
| 145 | +time. |
| 146 | + |
| 147 | +When completing a pull request, we will generally squash your changes into a single |
| 148 | +commit. After confirming that the change works as intended, the branch *might* be |
| 149 | +deleted, in order to prevent branch polluting. Please let us know if your pull request |
| 150 | +needs to be merged as separate commits. |
| 151 | + |
| 152 | +### Continuous Integration |
| 153 | + |
| 154 | +For this project, CI is provided by [GitHub Actions](https://github.com/features/actions), |
| 155 | +with workflows found in the [`.github/workflows` folder](.github/workflows). Workflows |
| 156 | +are run automatically on every commit made on the master branch, unless told to skip |
| 157 | +for that particular commit. |
| 158 | +<!-- |
| 159 | +To skip CI runs on a particular commit, include either `[skip ci]` or `[ci skip]` |
| 160 | +in the commit message. |
| 161 | +
|
| 162 | +```bash |
| 163 | +# an example of a commit message that would not trigger CI workflows |
| 164 | +git commit -m "my normal commit message [skip ci]" |
| 165 | +# or |
| 166 | +git commit -m "my normal commit message [ci skip]" |
| 167 | +``` |
| 168 | +--> |
| 169 | +## Review process |
| 170 | + |
| 171 | +After submitting a pull request, members of the team will review your code. We will |
| 172 | +assign the request to an appropriate reviewer (if applicable). Any member of the |
| 173 | +community may participate in the review, but at least one member of the project team |
| 174 | +will ultimately approve the request. |
| 175 | + |
| 176 | +Often, multiple iterations or discussions will be needed to responding to feedback |
| 177 | +from reviewers. Try looking at [past pull requests](https://github.com/arnaud-m/cryptator/pulls?q=is%3Apr+is%3Aclosed) |
| 178 | +to see what the experience might be like. |
| 179 | + |
| 180 | +<!-- |
| 181 | +## Contributor License Agreement |
| 182 | +
|
| 183 | +Before we can review and accept a pull request from you, you'll need to sign a |
| 184 | +Contributor License Agreement (CLA). The CLA ensures that the community is free |
| 185 | +to use your contributions. Signing the CLA is a manual process, and you need to |
| 186 | +do it for each pull request made. This is done by checking the boxes in the |
| 187 | +[Pull Request Readiness Checklist of a Pull Request](PULL_REQUEST_TEMPLATE.md#Pull-Request-Readiness-Checklist). |
| 188 | +
|
| 189 | +
|
| 190 | +### IMPORTANT |
| 191 | +
|
| 192 | +***Checking the aforementioned boxes means that you agree to provide your change |
| 193 | +and/or code FREE TO USE and SUBJECT TO CHANGES for the entire community!*** |
| 194 | +
|
| 195 | +You don't need to sign a CLA until you're ready to create a pull request. When your |
| 196 | +pull request is created, it is reviewed by a team member which, if the change is |
| 197 | +trivial (i.e. you just fixed a typo) will be labelled as `cla-not-required`. |
| 198 | +Otherwise, it's classified as `cla-required`, if not already signed. |
| 199 | +--> |
0 commit comments