|
1 | | -##Contributing to the unofficial WWDC app for macOS project |
| 1 | +# Contributing to the Unofficial WWDC app for macOS Project |
2 | 2 |
|
3 | 3 | Thanks for your interest in contributing to the project. Please make sure you follow the guidelines to maximize the chances of your contribution being accepted. |
4 | 4 |
|
5 | | -##1. Issues |
| 5 | +## 1. Issues |
6 | 6 |
|
7 | 7 | Here are the main reasons you might want to open an issue: |
8 | 8 |
|
9 | | -####I. Bugs |
| 9 | +#### I. Bugs |
10 | 10 |
|
11 | 11 | When the app behaves in an unexpected way or simply breaks, please file a bug report and describe what you were doing when the problem occurred, what was the expected result and what was the actual result. |
12 | 12 |
|
13 | 13 | Remember to include the version of the operating system you're running and the type/model of the machine (MacBook Mid 2009, iMac Late 2012, etc). |
14 | 14 |
|
15 | | -####II. Crashes |
| 15 | +#### II. Crashes |
16 | 16 |
|
17 | 17 | If you get a crash please open an issue and explain what you were trying to do when the crash happened, include a video or screenshots of the problem if possible. |
18 | 18 |
|
19 | 19 | Remember to include the version of the operating system you're running and the type/model of the machine (MacBook Mid 2009, iMac Late 2012, etc). |
20 | 20 |
|
21 | | -####III. Feature Requests |
| 21 | +#### III. Feature Requests |
22 | 22 |
|
23 | 23 | If you want a new feature to be implemented, you can open an issue explaining why the feature would be useful to you and to other people. |
24 | 24 |
|
25 | | -Keep in mind that we try to keep the app focused and exotic features or features which would add too much complexity to the code may be rejected. |
| 25 | +Whilst we want feature requests and suggestions to be as ambitious as possible, keep in mind that we try to keep the app focused, and niche features or features which would add a lot of complexity to the codebase may be rejected. If in doubt, it's better to suggest it than stay silent! |
26 | 26 |
|
27 | 27 | #### Issue template |
28 | 28 |
|
29 | 29 | Please follow the issue template provided when opening your issue, especially if it's a bug report. |
30 | 30 |
|
31 | | -##2. Code (Pull Requests) |
| 31 | +## 2. Code (Pull Requests) |
32 | 32 |
|
33 | | -**Important: pull requests that only contain refactoring of existing code without fixing any bugs, improving performance or implementing a new feature will not be accepted.** |
| 33 | +**Important: pull requests that only contain refactoring of existing code without fixing any bugs or linting messages, improving performance or implementing a new feature will not be accepted.** |
34 | 34 |
|
35 | | -####I. Tip: Ask before you code |
| 35 | +#### I. Tip: Ask before you code |
36 | 36 |
|
37 | | -It has happened a couple of times that we were working on a feature and someone opened a pull request implementing that same feature. This wastes time and effort because only one of the solutions will actually be used, so before you start coding I suggest you take a look at the open issues to see what's being worked on at the moment. If an issue already has someone assigned to it, don't start working on an implementation. It's also important to open an issue before working on a new feature if it's not already listed, because not every feature fits our vision of the app and we like to review feature ideas before implementing them. |
| 37 | +There have been a couple of times that we were working on a feature and someone opened a pull request implementing that same feature. This wastes time and effort because only one of the solutions can ultimately be used, so before you start coding we suggest you take a look at the open issues to see what's being worked on at the moment. If an issue already has someone assigned to it, don't start working on an implementation. If for some reason it's unclear whether they have made any progress or have time to continue, there's rarely any harm in asking. |
38 | 38 |
|
39 | | -If you see an open issue and you want to fix it, reply to the issue announcing that you're going to work on it so other people know there's someone already working on that. |
| 39 | +It's also useful to open an issue before working on a new feature if it's not already listed, because not every feature fits our vision of the app and we would rather communicate this before someone spends a significant chunk of time working on it. |
40 | 40 |
|
41 | | -####II. Use Swift |
| 41 | +If you see an open issue and you want to fix it, reply to the issue announcing that you're going to work on it so other people know there's someone already working on that. Similarly, if you ever need any help or guidance implementing something then adding a new comment to the issue will help us spot it quickly! We're a friendly bunch. |
| 42 | + |
| 43 | +#### II. Use Swift |
42 | 44 |
|
43 | 45 | All new code in the app should be written in Swift using the latest stable version of Xcode. |
44 | 46 |
|
45 | | -####III. Use spaces instead of tabs |
| 47 | +#### III. Keep indentation and style consistent |
46 | 48 |
|
47 | | -Do not start a war over this, I don't even have an opinion about this, I just use spaces because I contributed to some project once and people told me I had to use spaces, so I changed the setting in Xcode and never thought about it again, I have much more important stuff to worry about 🙄 |
| 49 | +And yes, this means spaces instead of tabs. 😉 It's not worth starting a war over this -- we're not strongly opinionated about it! We just have a clear precedent in the codebase that isn't worth uprooting years into the project -- it simply leads to noisier diffs. |
48 | 50 |
|
49 | | -Here's how my Xcode indentation preferences are, please use the same settings when working on this project: |
| 51 | +Here's how our Xcode indentation preferences look -- please try to use the same settings when working on the project: |
50 | 52 |
|
51 | 53 |  |
52 | 54 |
|
53 | | -####IV. Use `guard` and `return` early whenever possible |
| 55 | +#### IV. Use `guard` and `return` early whenever possible |
54 | 56 |
|
55 | 57 | Instead of doing something like this: |
56 | 58 |
|
@@ -90,7 +92,7 @@ func doSomethingIfNeeded(mustCallThis: (result: String) -> ()) { |
90 | 92 | } |
91 | 93 | ``` |
92 | 94 |
|
93 | | -####V. Avoid magic numbers and magic strings |
| 95 | +#### V. Avoid magic numbers and magic strings |
94 | 96 |
|
95 | 97 | If you need to reference specific numbers or strings, encapsulate them in `struct`s or `enum`s. |
96 | 98 |
|
@@ -141,24 +143,29 @@ class ImagesViewController: NSViewController { |
141 | 143 | } |
142 | 144 | ``` |
143 | 145 |
|
144 | | -####VI. Test your code thoroughly and follow linting rules |
| 146 | +#### VI. Test your code thoroughly and follow linting rules |
145 | 147 |
|
146 | 148 | When you think you're done with your contribution, try to break your code in as many different ways as possible to make sure your implementation is solid: |
147 | 149 |
|
148 | | -- If you change something related to the handling of user or application data (model layer) make sure to test the migration of data from a previous version of the app to your modified version. |
149 | | -- If you change a component related to networking, use the network link conditioner and test with a slow/bad connection to see how the app behaves |
| 150 | +- If you change something related to the handling of user or application data (model layer) make sure to test the migration of data from a [previous release version of the app](https://github.com/insidegui/WWDC/releases) to your modified version. |
| 151 | +- If you change a component related to networking, use Apple's Network Link Conditioner and test with a slow/bad connection to see how the app behaves. This conditioner is available from [`developer.apple.com`](https://developer.apple.com/download/more/), in the "Additional Tools for Xcode" bundle. |
150 | 152 | - If you change something related to UI, try resizing the window and looking at different content to make sure it can adapt well to different environments. |
151 | 153 |
|
152 | | - |
153 | 154 | Make sure your code is not introducing any new warnings, including those produced by Swiftlint. |
154 | 155 |
|
155 | | -####VII. Dependencies |
| 156 | +#### VII. Dependencies |
156 | 157 |
|
157 | | -Do not add dependencies to the project. |
| 158 | +Do not add dependencies to the project. In an ideal world, we would be masters of our own destiny. |
158 | 159 |
|
159 | 160 | Do not bring in assets (icons, images) for which you don't have an appropriate license. Icons and images must have a Creative Commons or similar license to be used in this project. A good place to find free icons is [Icon Finder](https://iconfinder.com). |
160 | 161 |
|
161 | | -##3. Conclusion |
| 162 | +## 3. Conduct |
| 163 | + |
| 164 | +The project has a [code of conduct](./CODE_OF_CONDUCT.md) that should be kept in mind when contributing -- whether that contribution is in the form of issues, comments, documentation or code. We reckon the fact that we've never had to enforce this is a pretty good sign of a healthy community, so let's keep it that way. 😉 |
| 165 | + |
| 166 | +Try to keep documentation and messages free of phrases that assume knowledge. If you're resorting to phrases like "obviously", "everyone knows" and "just", there's probably some context you're excluding. Not only does this help us be friendlier and more approachable for newcomers (bear in mind the app itself is an educational resource!), but it will probably help any programmer -- even you! -- who comes back to look at your code in months/years. |
| 167 | + |
| 168 | +## 4. Conclusion |
162 | 169 |
|
163 | 170 | These are just some suggestions for common scenarios, if you need help with your contribution you can always open an issue to discuss it before doing the pull request. |
164 | 171 |
|
|
0 commit comments