This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
/
CONTRIBUTING
48 lines (35 loc) · 2.92 KB
/
CONTRIBUTING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Contributing to swagger-gradle-plugin
We are a lovely group of people who are only here to make this better. We will not be horrible and expect that to be the same in return.
## Testing
As I'm sure you are aware, the current level of test coverage isn't fantastic, but with the new changes, all new code should _not_ reduce the line coverage of the tests and all code should be developed in a TDD manner.
## Submitting changes
Please send a [GitHub Pull Request to swagger-gradle-plugin](https://github.com/gigaSproule/swagger-gradle-plugin/pull/new/master) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). When the pull request is being merged, please ensure that the commits are squashed with a useful commit message (just a friendly reminder). Please follow our coding conventions (below).
Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:
```
$ git commit -m "A brief summary of the commit
>
> A paragraph describing what changed and its impact."
```
## Coding conventions
* Setup [editorconfig](http://editorconfig.org/#download) for formatting (so it's easy to enforce consistency)
* So we can have smaller files, the IntelliJ default import config (5 or more use *, 3 or more use * for static imports)
* We ALWAYS put spaces after list items and method parameters ([1, 2, 3], not [1,2,3]) and around operators (x += 1, not x+=1)
* Try to avoid unnecessary changes (makes the pull requests easier to read)
* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible
## To run integration tests
This plugin uses the [gradle testkit](https://docs.gradle.org/current/userguide/test_kit.html), so requires the testClasses task to be run before hand to get the classes into the test plugin classpath.
```bash
./gradlew :plugin:testClasses
```
N.B. for reliable test runs in an IDE, it's best to include this as a Gradle build step as part of the test run configuration.
## To run tests against different versions of Gradle
This plugin will by default run the tests against the Gradle versions specified on the official site drop down. To change which version it runs tests against, `test.gradleVersion` system property is required.
```bash
./gradlew clean :plugin:test -Dtest.gradleVersion=8.0.1
```
## To release
This plugin uses the [gradle-release](https://github.com/researchgate/gradle-release) plugin, so to release the plugin.
In `~/.gradle/gradle.properties`, `bintray_user` and `bintray_apiKey` need to be set for publishing to Bintray and `gradle.publish.key` and `gradle.publish.secret` for publishing to the central Gradle repository.
```bash
./gradlew :plugin:release -Prelease.useAutomaticVersion=true
```