|
| 1 | +# Contribution Guide |
| 2 | + |
| 3 | +There are many ways to be an open source contributor, and we're here to help you on your way! You may: |
| 4 | + |
| 5 | +* Raise an issue or feature request in our [issue tracker](#issues) |
| 6 | +* Help another contributor with one of their questions, or a code review |
| 7 | +* Suggest improvements to our Getting Started documentation by supplying a Pull Request |
| 8 | +* Evangelize our work together in conferences, podcasts, and social media spaces. |
| 9 | + |
| 10 | +This guide is for you. |
| 11 | + |
| 12 | +## Build |
| 13 | + |
| 14 | +### macOS / Linux |
| 15 | +```shell |
| 16 | +$> ./gradlew build |
| 17 | +``` |
| 18 | + |
| 19 | +### Windows |
| 20 | +```shell |
| 21 | +$> gradlew.bat build |
| 22 | +``` |
| 23 | + |
| 24 | +## Build the CLI Tool |
| 25 | +To build and install the CLI tool: |
| 26 | + |
| 27 | +```shell |
| 28 | +$> ./gradlew :kotlin-format:installShadowDist |
| 29 | +``` |
| 30 | +This will install the CLI to `kotlin-format/build/install/kotlin-format-shadow/` |
| 31 | + |
| 32 | +## Test |
| 33 | + |
| 34 | +### macOS / Linux |
| 35 | +```shell |
| 36 | +$> ./gradlew test |
| 37 | +``` |
| 38 | + |
| 39 | +### Windows |
| 40 | +```shell |
| 41 | +$> gradlew.bat test |
| 42 | +``` |
| 43 | + |
| 44 | +### Gradle build scans |
| 45 | + |
| 46 | +This project is configured to publish build scans to the public |
| 47 | +[build scan service](https://scans.gradle.com/). Publication is disabled by default but can be |
| 48 | +enabled by creating a `local.properties` file with the following contents: |
| 49 | + |
| 50 | +```properties |
| 51 | +kotlin.editor.build.scans.enable=true |
| 52 | +``` |
| 53 | + |
| 54 | +This file should not be checked into version control. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## Communications |
| 59 | + |
| 60 | +### Issues |
| 61 | + |
| 62 | +Anyone from the community is welcome (and encouraged!) to raise issues via |
| 63 | +[GitHub Issues](https://github.com/cashapp/kotlin-editor/issues) |
| 64 | + |
| 65 | +### Continuous Integration |
| 66 | + |
| 67 | +Build and Test cycles are run on every commit to every branch on [GitHub Actions](https://github.com/block/kotlin-formatter/actions). |
| 68 | + |
| 69 | +## Contribution |
| 70 | + |
| 71 | +We review contributions to the codebase via GitHub's Pull Request mechanism. We have |
| 72 | +the following guidelines to ease your experience and help our leads respond quickly |
| 73 | +to your valuable work: |
| 74 | + |
| 75 | +* Start by proposing a change either in Issues (most appropriate for small |
| 76 | + change requests or bug fixes) or in Discussions (most appropriate for design |
| 77 | + and architecture considerations, proposing a new feature, or where you'd |
| 78 | + like insight and feedback) |
| 79 | +* Cultivate consensus around your ideas; the project leads will help you |
| 80 | + pre-flight how beneficial the proposal might be to the project. Developing early |
| 81 | + buy-in will help others understand what you're looking to do, and give you a |
| 82 | + greater chance of your contributions making it into the codebase! No one wants to |
| 83 | + see work done in an area that's unlikely to be incorporated into the codebase. |
| 84 | +* Fork the repo into your own namespace/remote |
| 85 | +* Work in a dedicated feature branch. Atlassian wrote a great |
| 86 | + [description of this workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) |
| 87 | +* When you're ready to offer your work to the project, first: |
| 88 | +* Squash your commits into a single one (or an appropriate small number of commits), and |
| 89 | + rebase atop the upstream `main` branch. This will limit the potential for merge |
| 90 | + conflicts during review, and helps keep the audit trail clean. A good writeup for |
| 91 | + how this is done is |
| 92 | + [here](https://medium.com/@slamflipstrom/a-beginners-guide-to-squashing-commits-with-git-rebase-8185cf6e62ec), and if you're |
| 93 | + having trouble - feel free to ask a member or the community for help or leave the commits as-is, and flag that you'd like |
| 94 | + rebasing assistance in your PR! We're here to support you. |
| 95 | +* Open a PR in the project to bring in the code from your feature branch. |
| 96 | +* The maintainers noted in the `CODEOWNERS` file will review your PR and optionally |
| 97 | + open a discussion about its contents before moving forward. |
| 98 | +* Remain responsive to follow-up questions, be open to making requested changes, and... |
| 99 | + You're a contributor! |
| 100 | +* And remember to respect everyone in our global development community. Guidelines |
| 101 | + are established in our `CODE_OF_CONDUCT.md`. |
0 commit comments