CONTRIBUTING.md 5.3 KB
Newer Older
1
## Contributing  to the Spring Framework
2

3 4
First off, thank you for taking the time to contribute!

5
*Table of Contents*
6

7 8 9 10 11 12 13
* [Code of Conduct](#Code-of-Conduct)
* [How to Contribute](#How-to-Contribute)
  * [Discuss](#Discuss)
  * [Create a Ticket](#Create-a-Ticket)
  * [Submit a Pull Request](#Submit-a-Pull-Request)
* [Source Code Style](#Source-Code-Style)
* [Reference Docs](#Reference-Docs)
14

15
### Code of Conduct
16

17
This project is governed by the [Spring Code of Conduct](CODE_OF_CONDUCT.adoc).
18 19 20
By participating you are expected to uphold this code.
Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.

21
### How to Contribute
22

23
#### Discuss
24

25
If you have a question, check StackOverflow using
26
[this list of tags](https://spring.io/questions), organized by Spring project.
27
Find an existing discussion or start a new one if necessary.
28

29
If you suspect an issue, perform a search in the
30
[JIRA issue tracker](https://jira.spring.io/browse/SPR), using a few different keywords.
31 32
When you find related issues and discussions, prior or current, it helps you to learn and
it helps us to make a decision.
33

34
#### Create a Ticket
35

36 37
Reporting an issue or making a feature request is a great way to contribute. Your feedback
and the conversations that result from it provide a continuous flow of ideas. However,
38
before you do that, please take the time to [research first](#Discuss).
39

40 41 42 43 44
When an issue is first created, it may not be assigned and will not have a fix version.
Within a day or two, the issue is assigned to a specific committer and the target
version is set to "Waiting for Triage". The committer will then review the issue, ask for
further information if needed, and based on the findings, the issue is either assigned a fix
version or rejected.
45

46 47 48
When a fix is ready, the issue is marked "Resolved" and may still be re-opened. Once a fix
is released, the issue is permanently "Closed". If necessary, you will need to create a new,
related ticket with a fresh description.
49

50
#### Submit a Pull Request
51 52 53 54

You can contribute a source code change by submitting a pull request.

1. If you have not previously done so, please sign the
55
[Contributor License Agreement](https://cla.pivotal.io/sign/spring). You will also be reminded
56 57
automatically when you submit a pull request.

58 59 60 61 62
1. For all but the most trivial of contributions, please [create a ticket](#Create-a-Ticket).
The purpose of the ticket is to understand and discuss the underlying issue or feature.
We use the JIRA issue tracker as the preferred place of record for conversations and
conclusions. In that sense discussions directly under a PR are more implementation detail
oriented and transient in nature.
63 64

1. Always check out the `master` branch and submit pull requests against it
65
(for target version see [settings.gradle](settings.gradle)).
66 67 68 69 70 71 72 73
Backports to prior versions will be considered on a case-by-case basis and reflected as
the fix version in the issue tracker.

1. Use short branch names, preferably based on the JIRA issue (e.g. `SPR-1234`), or
otherwise using succinct, lower-case, dash (-) delimited names, such as `fix-warnings'.

1. Choose the granularity of your commits consciously and squash commits that represent
multiple edits or corrections of the same logical change. See
74
[Rewriting History section of Pro Git](http://git-scm.com/book/en/Git-Tools-Rewriting-History)
75
for an overview of streamlining commit history.
76

77 78 79
1. Format commit messages using 55 characters for the subject line, 72 lines for the
description, followed by related issues, e.g. `Issues: SPR-1234, SPR-1235`.
See the
80
[Commit Guidelines section of Pro Git](http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)
81
for best practices around commit messages and use `git log` to see some examples.
82

83
1. List the JIRA issue number in the PR description.
84

85 86 87
If accepted, your contribution may be heavily modified as needed prior to merging.
You will likely retain author attribution for your Git commits granted that the bulk of
your changes remain intact. You may also be asked to rework the submission.
88

89 90 91
If asked to make corrections, simply push the changes against the same branch, and your
pull request will be updated. In other words, you do not need to create a new pull request
when asked to make changes.
92

93
### Source Code Style
94

95 96 97 98
The wiki page
[Spring Framework Code Style](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Code-Style)
defines the source file coding standards we use while the [IDEA formatting](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-IDEA-Code-Formatting)
page describes the changes we make to the default code formatting settings in IntelliJ IDEA.
99

100
### Reference Docs
101

102 103
The reference documentation is in the [src/docs/asciidoc](src/docs/asciidoc) directory and, in
[Asciidoctor](http://asciidoctor.org/) format. For trivial changes, you may be able to browse,
104
edit source files, and submit directly from Github.
105

106 107
When making changes locally, use `./gradlew asciidoctor` and then browse the result under
`build/asciidoc/html5/index.html`.
108

109
Asciidoctor also supports live editing. For more details read
110
[Editing AsciiDoc with Live Preview](http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/).
111
Note that if you choose the
112
[System Monitor](http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/#using-a-system-monitor)
113
option, you can find a Guardfile under `src/docs/asciidoc`.