|
| 1 | +# Contributing |
| 2 | + |
| 3 | +## Environment setup |
| 4 | + |
| 5 | +- Fork and clone SwiftMacroToolkit |
| 6 | +- Open the package in your editor of choice and you're ready to code, have fun! |
| 7 | + |
| 8 | +## Contribution workflow |
| 9 | + |
| 10 | +- Look through the issues on GitHub and choose an issue to work on (or open one if you have an idea) |
| 11 | +- Leave a comment on the issue to let people know that you're working on it |
| 12 | +- Make necessary changes to the codebase |
| 13 | +- Open a PR, making sure to reference the issue that your changes address |
| 14 | +- If a maintainer requests changes, implement the changes |
| 15 | +- A maintainer will merge the changes and the issue can be closed |
| 16 | + |
| 17 | +Thank you for improving SwiftMacroToolkit! |
| 18 | + |
| 19 | +## Before opening a PR |
| 20 | + |
| 21 | +- [ ] Document any new code and update existing documentation as necessary |
| 22 | +- [ ] Ensure that you haven't introduced any new warnings |
| 23 | +- [ ] Check that `swift build` and `swift test` both succeed |
| 24 | + |
| 25 | +Feel free to open a draft PR before you've completed the checklist if you want feedback. |
| 26 | + |
| 27 | +## Package structure |
| 28 | + |
| 29 | +- `Sources/MacroToolkit`: The toolkit itself |
| 30 | +- `Sources/MacroToolkitExample`: Declarations of some example macros which are tested by the tests |
| 31 | +- `Sources/MacroToolkitExamplePlugin`: Implementations for the macros declared by `MacroToolkitExample` |
| 32 | +- `Tests/MacroToolkitTests`: The tests for the toolkit. They simply test that the example macros are |
| 33 | + working correctly, acting as integration tests for the toolkit. Ideally these will eventually be |
| 34 | + complimented by more specific unit tests. |
| 35 | + |
| 36 | +## Codestyle |
| 37 | + |
| 38 | +- 4 space tabs |
| 39 | +- Add comments to any code you think would need explaining to other contributors. |
| 40 | +- Document all methods, properties, classes, structs, protocols and enums with documentation comments (if it's trivial, |
| 41 | + you can just keep the documentation comment short). In Xcode you can press option+cmd+/ when your cursor is on a |
| 42 | + declaration to autogenerate a template documentation comment (it mostly works). |
| 43 | +- Avoid using shorthand when the alternative is more readable at a glance. |
0 commit comments