CONTRIBUTING.md 5.6 KB
Newer Older
R
Polish  
Rossen Stoyanchev 已提交
1
# Contributing  to the Spring Framework
2

R
Rossen Stoyanchev 已提交
3
First off, thank you for taking the time to contribute! :+1: :tada: 
4

R
Polish  
Rossen Stoyanchev 已提交
5
### Table of Contents
6

R
Rossen Stoyanchev 已提交
7 8 9 10 11 12 13 14
* [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)
* [Build from Source](#build-from-source)
* [Source Code Style](#source-code-style)
* [Reference Docs](#reference-docs)
15

16
### Code of Conduct
17

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

22
### How to Contribute
23

24
#### Discuss
25

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

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

35
#### Create a Ticket
36

37 38
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,
39
before you do that, please take the time to [research first](#Discuss).
40

41 42 43 44 45
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.
46

47 48 49
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.
50

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

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

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

59 60 61 62 63
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.
64 65

1. Always check out the `master` branch and submit pull requests against it
66
(for target version see [settings.gradle](settings.gradle)).
67 68 69 70 71 72 73 74
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
75
[Rewriting History section of Pro Git](http://git-scm.com/book/en/Git-Tools-Rewriting-History)
76
for an overview of streamlining commit history.
77

78 79 80
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
81
[Commit Guidelines section of Pro Git](http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)
82
for best practices around commit messages and use `git log` to see some examples.
83

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

86 87 88
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.
89

90 91 92
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.
93

94 95 96 97 98 99
### Build from Source

See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source)
wiki page for instructions on how to check out, build, and import the Spring Framework
source code into your IDE.

100
### Source Code Style
101

R
Rossen Stoyanchev 已提交
102 103 104 105
The wiki pages
[Code Style](https://github.com/spring-projects/spring-framework/wiki/Code-Style) and
[IntelliJ IDEA Editor Settings](https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings)
defines the source file coding standards we use along with some IDEA editor settings we customize.
106

107
### Reference Docs
108

109 110
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,
111
edit source files, and submit directly from Github.
112

113 114
When making changes locally, use `./gradlew asciidoctor` and then browse the result under
`build/asciidoc/html5/index.html`.
115

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