You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several fixes were applied: Syntax corrected, links updated, improved
some paragraphs, restored parts that were removed in the conversion to
adoc format (see: a8b4385)
@@ -4,27 +4,27 @@ _Please refer back to this document as a checklist before issuing any pull reque
4
4
5
5
= Code of Conduct
6
6
7
-
Please see our https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md[code of conduct]
7
+
Please see our https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md[code of conduct].
8
8
9
9
= Similar but different
10
10
11
-
Each Spring module is slightly different than another in terms of team size, number of issues, etc. Therefore each project is managed slightly different. You will notice that this document is very similar to the https://github.com/spring-projects/spring-framework/wiki/Contributor-guidelines[Spring Framework Contributor guidelines]. However, there are some subtle differences between the two documents, so please be sure to read this document thoroughly.
11
+
Each Spring module is slightly different from one another in terms of team size, number of issues, etc. Therefore, each project is managed slightly different. You will notice that this document is very similar to the https://github.com/spring-projects/spring-framework/wiki/Contributor-guidelines[Spring Framework Contributor guidelines]. However, there are some subtle differences between the two documents, so please be sure to read this document thoroughly.
12
12
13
13
= Importing into IDE
14
14
15
15
The following provides information on setting up a development environment that can run the sample in https://www.springsource.org/sts[Spring Tool Suite 3.6.0+]. Other IDE's should work using Gradle's IDE support, but have not been tested.
16
16
17
17
* IDE Setup
18
-
* Install Spring Tool Suite 3.6.0+
19
-
* You will need the following plugins installed (can be found on the Extensions Page)
20
-
* Gradle Eclipse
21
-
* Groovy Eclipse
18
+
** Install Spring Tool Suite 3.6.0+
19
+
** You will need the following plugins installed (can be found on the Extensions Page)
20
+
*** Gradle Eclipse
21
+
*** Groovy Eclipse
22
22
* Importing the project into Spring Tool Suite
23
-
* File->Import…->Gradle Project
23
+
** File -> Import… -> Gradle Project
24
24
25
-
As of new versions of Spring Tool Suite, you might need to install Groovy Eclipse pointing directly to the updates plugin location. To install Groovy Eclipse on Spring Tool Suite based on Eclipse Oxigen you must do the following steps:
25
+
As of new versions of Spring Tool Suite, you might need to install Groovy Eclipse pointing directly to the updated plugin location. To install Groovy Eclipse on Spring Tool Suite based on Eclipse Oxigen you must do the following steps:
26
26
27
-
Help->Install New Software…->Add the following URL into _Work with_ field:
27
+
Help -> Install New Software… -> Add the following URL into _Work with_ field:
@@ -33,78 +33,101 @@ Not sure what a pull request is, or how to submit one? Take a look at GitHub's e
33
33
34
34
= Search GitHub issues; create an issue if necessary
35
35
36
-
Is there already an issue that addresses your concern? Do a bit of searching in our https://github.com/spring-projects/spring-security/issues[GitHub issues] to see if you can find something similar. If not, please create a new issue before submitting a pull request unless the change is not a user facing issue.
36
+
Is there already an issue that addresses your concern? Do a bit of searching in our https://github.com/spring-projects/spring-security/issues[GitHub issues] to see if you can find something similar. If not, please create a new issue before submitting a pull request unless the change is not a user facing issue.
37
37
38
38
= Discuss non-trivial contribution ideas with committers
39
39
40
40
If you're considering anything more than correcting a typo or fixing a minor bug, please discuss it on the https://gitter.im/spring-projects/spring-security[Spring Security Gitter] before submitting a pull request. We're happy to provide guidance but please spend an hour or two researching the subject on your own including searching the forums for prior discussions.
41
41
42
42
= Sign the Contributor License Agreement
43
43
44
-
If you have not previously done so, please fill out and
45
-
submit the https://cla.pivotal.io/sign/spring[Contributor License Agreement].
44
+
If you have not previously done so, please fill out and submit the https://cla.pivotal.io/sign/spring[Contributor License Agreement].
46
45
47
46
= Create your branch from master
48
47
49
48
Create your topic branch to be submitted as a pull request from master. The Spring team will consider your pull request for backporting on a case-by-case basis; you don't need to worry about submitting anything for backporting.
50
49
51
50
= Use short branch names
52
51
53
-
Branches used when submitting pull requests should preferably be named according to GitHub issues, e.g. 'gh-1234' or 'gh-1234-fix-npe'. Otherwise, use succinct, lower-case, dash (-) delimited names, such as 'fix-warnings', 'fix-typo', etc. This is important, because branch names show up in the merge commits that result from accepting pull requests, and should be as expressive and concise as possible.
52
+
Branches used when submitting pull requests should preferably be named according to GitHub issues, e.g. `gh-1234` or `gh-1234-fix-npe`. Otherwise, use succinct, lower-case, dash (`-`) delimited names, such as `fix-warnings` or `fix-typo`. This is important, because branch names show up in the merge commits that result from accepting pull requests, and should be as expressive and concise as possible.
54
53
55
54
= Keep commits focused
56
55
57
56
Remember each ticket should be focused on a single item of interest since the tickets are used to produce the changelog. Since each commit should be tied to a single GitHub issue, ensure that your commits are focused. For example, do not include an update to a transitive library in your commit unless the GitHub is to update the library. Reviewing your commits is essential before sending a pull request.
58
57
59
58
= Mind the whitespace
60
59
61
-
Please carefully follow the whitespace and formatting conventions already present in the framework.
60
+
Please carefully follow the whitespace and formatting conventions already present in the framework.
62
61
63
62
. Tabs, not spaces
64
63
. Unix (LF), not dos (CRLF) line endings
65
64
. Eliminate all trailing whitespace
66
65
. Aim to wrap code at 120 characters, but favor readability over wrapping
67
66
. Preserve existing formatting; i.e. do not reformat code for its own sake
68
-
. Search the codebase using git grep and other tools to discover common naming conventions, etc.
67
+
. Search the codebase using `git grep` and other tools to discover common naming conventions, etc.
69
68
. UTF-8 encoding for Java sources and XML files
70
69
71
70
Whitespace management tips
72
71
73
72
. You can use the https://marketplace.eclipse.org/content/anyedit-tools[AnyEdit Eclipse plugin] to ensure spaces are used and to clean up trailing whitespaces.
74
-
. Use git's pre-commit.sample hook to prevent invalid whitespace from being pushed out. You can enable it by moving ~/spring-security/.git/hooks/pre-commit.sample to ~/spring-security/.git/hooks/pre-commit and ensuring it is executable. For more information on hooks refer to https://git-scm.com/book/cs/ch7-3.html[Pro Git's Pre-Commit Hook's section]
73
+
. Use Git's `pre-commit.sample` hook to prevent invalid whitespace from being pushed out. You can enable it by moving `.git/hooks/pre-commit.sample` to `.git/hooks/pre-commit` and ensuring it is executable. For more information on hooks refer to https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks[https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks].
75
74
76
75
= Add Apache license header to all new classes
77
76
77
+
----
78
+
/*
79
+
* Copyright 2002-2020 the original author or authors.
80
+
*
81
+
* Licensed under the Apache License, Version 2.0 (the "License");
82
+
* you may not use this file except in compliance with the License.
83
+
* You may obtain a copy of the License at
84
+
*
85
+
* https://www.apache.org/licenses/LICENSE-2.0
86
+
*
87
+
* Unless required by applicable law or agreed to in writing, software
88
+
* distributed under the License is distributed on an "AS IS" BASIS,
89
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90
+
* See the License for the specific language governing permissions and
91
+
* limitations under the License.
92
+
*/
93
+
94
+
package ...;
95
+
----
96
+
78
97
= Update Apache license header to modified files as necessary
79
98
80
-
Always check the date range in the license header. For example, if you've modified a file in 2012 whose header still reads
81
-
<pre>
82
-
* Copyright 2002-2011 the original author or authors.
83
-
</pre>
84
-
then be sure to update it to 2012 appropriately
85
-
<pre>
99
+
Always check the date range in the license header. For example, if you've modified a file in 2020 whose header still reads
100
+
101
+
----
86
102
* Copyright 2002-2012 the original author or authors.
87
-
</pre>
103
+
----
104
+
105
+
then be sure to update it to the current year appropriately (e.g. 2020)
106
+
107
+
----
108
+
* Copyright 2002-2020 the original author or authors.
109
+
----
88
110
89
111
= Use @since tags for newly-added public API types and methods
90
112
91
-
e.g.
92
-
<pre>
113
+
Example:
114
+
115
+
----
93
116
/**
94
117
* …
95
118
*
96
119
* @author First Last
97
-
* @since 3.2
120
+
* @since 5.4
98
121
* @see …
99
122
*/
100
-
</pre>
123
+
----
101
124
102
125
= Submit JUnit test cases for all behavior changes
103
126
104
-
Search the codebase to find related unit tests and add additional `@Test` methods within.
127
+
Search the codebase to find related unit tests and add additional `@Test` methods within.
105
128
106
-
. Any new tests should end in the name Tests (note this is plural). For example, a valid name would be `FilterChainProxyTests`. An invalid name would be `FilterChainProxyTest`.
107
-
. New test methods should not start with test. This is an old JUnit3 convention and is not necessary since the method is annotated with @Test.
129
+
. Any new tests should end in the name `Tests` (note this is plural). For example, a valid name would be `FilterChainProxyTests`. An invalid name would be `FilterChainProxyTest`.
130
+
. New test methods should not start with test. This is an old JUnit3 convention and is not necessary since the method is annotated with `@Test`.
108
131
109
132
= Update spring-security-x.y.rnc for schema changes
110
133
@@ -114,44 +137,76 @@ Changes to the XML schema will be overwritten by the Gradle build task.
114
137
115
138
= Squash commits
116
139
117
-
Use git rebase –interactive, git add –patch and other tools to "squash" multiple commits into atomic changes. In addition to the man pages for git, there are many resources online to help you understand how these tools work. Here is one: https://book.git-scm.com/4_interactive_rebasing.html[https://book.git-scm.com/4_interactive_rebasing.html].
140
+
Use `git rebase --interactive`, `git add --patch` and other tools to "squash" multiple commits into atomic changes. In addition to the man pages for `git`, there are https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History[many resources online] to help you understand how these tools work.
118
141
119
142
= Use real name in git commits
120
143
121
-
Please configure git to use your real first and last name for any commits you intend to submit as pull requests. For example, this is not acceptable:
144
+
Please configure Git to use your real first and last name for any commits you intend to submit as pull requests. Make sure the name is properly capitalized as submitted to the https://cla.pivotal.io[Pivotal Contributor License Agreement]:
Rather, please include your first and last name, properly capitalized, as submitted against the SpringSource contributor license agreement:
124
-
<pre>
125
-
Author: First Last <link:mailto:user@mail.com&gt[user@mail.com&gt];
126
-
</pre>
127
-
This helps ensure traceability against the CLA, and also goes a long way to ensuring useful output from tools like git shortlog and others.
150
+
This helps ensure traceability against the CLA, and also goes a long way to ensuring useful output from tools like Git shortlog and others.
128
151
129
-
You can configure this globally via the account admin area GitHub (useful for fork-and-edit cases); globally with
152
+
You can configure this globally:
130
153
131
-
or locally for the spring-security repository only by omitting the '–global' flag:
. Keep the subject line to 50 characters or less if possible
141
169
. Do not end the subject line with a period
142
170
. In the body of the commit message, explain how things worked before this commit, what has changed, and how things work now
143
-
. Include Closes gh-<issue-number> at the end if this fixes a GitHub issue
171
+
. Include `Closes gh-<issue-number>` at the end if this fixes a GitHub issue
144
172
. Avoid markdown, including back-ticks identifying code
145
173
174
+
Example:
175
+
176
+
----
177
+
Short (50 chars or less) summary of changes
178
+
179
+
More detailed explanatory text, if necessary. Wrap it to about 72
180
+
characters or so. In some contexts, the first line is treated as the
181
+
subject of an email and the rest of the text as the body. The blank
182
+
line separating the summary from the body is critical (unless you omit
183
+
the body entirely); tools like rebase can get confused if you run the
184
+
two together.
185
+
186
+
Further paragraphs come after blank lines.
187
+
188
+
- Bullet points are okay, too
189
+
190
+
- Typically a hyphen or asterisk is used for the bullet, preceded by a
191
+
single space, with blank lines in between, but conventions vary here
192
+
193
+
Closes gh-123
194
+
----
195
+
196
+
146
197
= Run all tests prior to submission
147
198
199
+
----
200
+
./gradlew clean build integrationTest
201
+
----
202
+
148
203
= Submit your pull request
149
204
150
-
Subject line:
205
+
*Subject line:*
151
206
152
207
Follow the same conventions for pull request subject lines as mentioned above for commit message subject lines.
153
208
154
-
In the body:
209
+
*In the body:*
155
210
156
211
. Explain your use case. What led you to submit this change? Why were existing mechanisms in the framework insufficient? Make a case that this is a general-purpose problem and that yours is a general-purpose solution, etc
157
212
. Add any additional information and ask questions; start a conversation, or continue one from GitHub Issues
@@ -167,4 +222,4 @@ Add a comment to the associated GitHub issue(s) linking to your new pull request
167
222
168
223
The Spring team takes a very conservative approach to accepting contributions to the framework. This is to keep code quality and stability as high as possible, and to keep complexity at a minimum. Your changes, if accepted, may be heavily modified prior to merging. You will retain "Author:" attribution for your Git commits granted that the bulk of your changes remain intact. You may be asked to rework the submission for style (as explained above) and/or substance. Again, we strongly recommend discussing any serious submissions with the Spring Framework team prior to engaging in serious development work.
169
224
170
-
Note that you can always force push (git push -f) reworked / rebased commits against the branch used to submit your pull request. i.e. you do not need to issue a new pull request when asked to make changes.
225
+
Note that you can always force push (`git push -f`) reworked / rebased commits against the branch used to submit your pull request. i.e. you do not need to issue a new pull request when asked to make changes.
0 commit comments