Skip to content

Commit be015eb

Browse files
committed
Update CONTRIBUTING.md
1 parent 8718089 commit be015eb

File tree

1 file changed

+33
-38
lines changed

1 file changed

+33
-38
lines changed

CONTRIBUTING.md

+33-38
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Contributor Guidelines
22
======================
33

4-
Have something you'd like to contribute to **Spring Batch Extensions**? We welcome pull requests, but ask that you carefully read this document first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring team when evaluating your submission.
4+
Have something you'd like to contribute to **Spring Batch Extensions**? We welcome pull requests,
5+
but ask that you carefully read this document first to understand how best to submit them;
6+
what kind of changes are likely to be accepted; and what to expect from the Spring team when evaluating your submission.
57

68
Please refer back to this document as a checklist before issuing any pull request; this will save time for everyone!
79

@@ -11,11 +13,15 @@ Not sure what a *pull request* is, or how to submit one? Take a look at GitHub'
1113

1214
## Search the [GitHub Issue Tracker][] first; create an issue if necessary
1315

14-
Is there already an issue that addresses your concern? Do a bit of searching in our [GitHub Issue Tracker][] to see if you can find something similar. If not, please create a new issue before submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc.
16+
Is there already an issue that addresses your concern? Do a bit of searching in our [GitHub Issue Tracker][] to see
17+
if you can find something similar. If not, please create a new issue before submitting a pull request unless the change
18+
is truly trivial, e.g. typo fixes, removing compiler warnings, etc.
1519

1620
## Sign the contributor license agreement
1721

18-
Very important, before we can accept any *Spring Batch contributions*, we will need you to sign the contributor license agreement (CLA). Signing the CLA does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. In order to read and sign the CLA, please go to:
22+
Very important, before we can accept any *Spring Batch contributions*, we will need you to sign the contributor license agreement (CLA).
23+
Signing the CLA does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions,
24+
and you will get an author credit if we do. In order to read and sign the CLA, please go to:
1925

2026
* [https://support.springsource.com/spring_committer_signup](https://support.springsource.com/spring_committer_signup)
2127

@@ -40,42 +46,41 @@ Once you've completed the web form, simply add the following in a comment on you
4046
_you should see only 'origin' - which is the fork you created for your own github account_
4147
4. `git remote add upstream [email protected]:spring-projects/spring-batch-extensions.git`
4248
5. `git remote show`
43-
_you should now see 'upstream' in addition to 'origin' where 'upstream' is the *spring-projects*repository from which releases are built_
49+
_you should now see 'upstream' in addition to 'origin' where 'upstream' is the *spring-projects* repository from which releases are built_
4450
6. `git fetch --all`
4551
7. `git branch -a`
4652
_you should see branches on origin as well as upstream, including 'master'_
4753

4854
## A Day in the Life of a Contributor
4955

50-
* _Always_ work on topic branches (Typically an issue ID or descriptive identifier as the branch name).
51-
- For example, to create and switch to a new branch for issue BATCHEXT-123: `git checkout -b BATCHEXT-123`
56+
* _Always_ work on topic branches (Typically an issue ID or descriptive identifier as the branch name). For example, to create and switch to a new branch for issue BATCH-EXT-123: `git checkout -b BATCH-EXT-123`
5257
* You might be working on several different topic branches at any given time, but when at a stopping point for one of those branches, commit (a local operation).
53-
* Please follow the "Commit Guidelines" described in this chapter of Pro Git: [https://progit.org/book/ch5-2.html](https://progit.org/book/ch5-2.html)
54-
* Then to begin working on another issue (say BATCHEXT-101): `git checkout BATCHEXT-101`. The _-b_ flag is not needed if that branch already exists in your local repository.
55-
* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin BATCHEXT-123`
58+
* Please follow the "Commit Guidelines" described in this chapter of Pro Git: [Distributed Git - Contributing to a Project](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines)
59+
* Then to begin working on another issue (say BATCH-EXT-101): `git checkout BATCH-EXT-101`. The _-b_ flag is not needed if that branch already exists in your local repository.
60+
* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin BATCH-EXT-123`
5661
* If you want to collaborate with another contributor, have them fork your repository (add it as a remote) and `git fetch <your-username>` to grab your branch. Alternatively, they can use `git fetch --all` to sync their local state with all of their remotes.
5762
* If you grant that collaborator push access to your repository, they can even apply their changes to your branch.
58-
* When ready for your contribution to be reviewed for potential inclusion in the master branch of the canonical *spring-batch-extensions* repository (what you know as 'upstream'), issue a pull request to the *spring-batch-extensions* repository (for more detail, see [https://help.github.com/send-pull-requests/](https://help.github.com/send-pull-requests/)).
63+
* When ready for your contribution to be reviewed for potential inclusion in the master branch of the canonical *spring-batch-extensions* repository (what you know as 'upstream'), issue a pull request to the *spring-batch-extensions* repository (for more detail, see [help documentation][]).
5964
* The project lead may merge your changes into the upstream master branch as-is, he may keep the pull request open yet add a comment about something that should be modified, or he might reject the pull request by closing it.
60-
* A prerequisite for any pull request is that it will be cleanly merge-able with the upstream master's current state. **This is the responsibility of any contributor.** If your pull request cannot be applied cleanly, the project lead will most likely add a comment requesting that you make it merge-able. For a full explanation, see the Pro Git section on rebasing: [https://progit.org/book/ch3-6.html](https://progit.org/book/ch3-6.html). As stated there: "> Often, you’ll do this to make sure your commits apply cleanly on a remote branch — perhaps in a project to which you’re trying to contribute but that you don’t maintain."
65+
* A prerequisite for any pull request is that it will be cleanly merge-able with the upstream master's current state. **This is the responsibility of any contributor.** If your pull request cannot be applied cleanly, the project lead will most likely add a comment requesting that you make it merge-able. For a full explanation, see the Pro Git section on rebasing: [Git Branching - Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing). As stated there: "> Often, you’ll do this to make sure your commits apply cleanly on a remote branch — perhaps in a project to which you’re trying to contribute but that you don’t maintain."
6166

6267
## Keeping your Local Code in Sync
6368
* As mentioned above, you should always work on topic branches (since 'master' is a moving target). However, you do want to always keep your own 'origin' master branch in synch with the 'upstream' master.
6469
* Within your local working directory, you can sync up all remotes' branches with: `git fetch --all`
6570
* While on your own local master branch: `git pull upstream master` (which is the equivalent of fetching upstream/master and merging that into the branch you are in currently)
66-
* Now that you're in synch, switch to the topic branch where you plan to work, e.g.: `git checkout -b BATCHEXT-123`
71+
* Now that you're in synch, switch to the topic branch where you plan to work, e.g.: `git checkout -b BATCH-EXT-123`
6772
* When you get to a stopping point: `git commit`
6873
* If changes have occurred on the upstream/master while you were working you can synch again:
6974
- Switch back to master: `git checkout master`
7075
- Then: `git pull upstream master`
71-
- Switch back to the topic branch: `git checkout BATCHEXT-123` (no -b needed since the branch already exists)
72-
- Rebase the topic branch to minimize the distance between it and your recently synched master branch: `git rebase master`
73-
(Again, for more detail see the Pro Git section on rebasing: [https://progit.org/book/ch3-6.html](https://progit.org/book/ch3-6.html))
76+
- Switch back to the topic branch: `git checkout BATCH-EXT-123` (no -b needed since the branch already exists)
77+
- Rebase the topic branch to minimize the distance between it and your recently synchronized master branch: `git rebase master`
78+
(Again, for more detail see the Pro Git section on rebasing: [Git Branching - Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing))
7479
* **Note** You cannot rebase if you have already pushed your branch to your remote because you'd be rewriting history (see **'The Perils of Rebasing'** in the article). If you rebase by mistake, you can undo it as discussed [in this stackoverflow discussion](https://stackoverflow.com/questions/134882/undoing-a-git-rebase). Once you have published your branch, you need to merge in the master rather than rebasing.
7580
* Now, if you issue a pull request, it is much more likely to be merged without conflicts. Most likely, any pull request that would produce conflicts will be deferred until the issuer of that pull request makes these adjustments.
7681
* Assuming your pull request is merged into the 'upstream' master, you will actually end up pulling that change into your own master eventually, and at that time, you may decide to delete the topic branch from your local repository and your fork (origin) if you pushed it there.
77-
- to delete the local branch: `git branch -d BATCHEXT-123`
78-
- to delete the branch from your origin: `git push origin :BATCHEXT-123`
82+
- to delete the local branch: `git branch -d BATCH-EXT-123`
83+
- to delete the branch from your origin: `git push origin :BATCH-EXT-123`
7984

8085
## Maintain a linear commit history
8186

@@ -103,24 +108,13 @@ If you see intersecting lines, that usually means that you forgot to rebase you
103108

104109
## Mind the whitespace
105110

106-
Please carefully follow the whitespace and formatting conventions already present in the framework.
107-
108-
1. Tabs, not spaces
109-
2. Unix (LF), not DOS (CRLF) line endings
110-
3. Eliminate all trailing whitespace
111-
4. Wrap Javadoc at 90 characters
112-
5. Aim to wrap code at 90 characters, but favor readability over wrapping
113-
6. Preserve existing formatting; i.e. do not reformat code for its own sake
114-
7. Search the codebase using `git grep` and other tools to discover common
115-
naming conventions, etc.
116-
8. Latin-1 (ISO-8859-1) encoding for Java sources; use `native2ascii` to convert
117-
if necessary
111+
Please carefully follow the same [code style as Spring Framework](https://github.com/spring-projects/spring-framework/wiki/Code-Style).
118112

119113
## Add Apache license header to all new classes
120114

121115
```java
122116
/*
123-
* Copyright 2002-2014 the original author or authors.
117+
* Copyright 2002-2021 the original author or authors.
124118
*
125119
* Licensed under the Apache License, Version 2.0 (the "License");
126120
* you may not use this file except in compliance with the License.
@@ -140,16 +134,16 @@ package ...;
140134

141135
## Update license header to modified files as necessary
142136

143-
Always check the date range in the Apache license header. For example, if you've modified a file in 2014 whose header still reads
137+
Always check the date range in the Apache license header. For example, if you've modified a file in 2021 whose header still reads
144138

145139
```java
146140
* Copyright 2002-2011 the original author or authors.
147141
```
148142

149-
then be sure to update it to 2014 appropriately
143+
then be sure to update it to 2021 appropriately
150144

151145
```java
152-
* Copyright 2002-2014 the original author or authors.
146+
* Copyright 2002-2021 the original author or authors.
153147
```
154148

155149
## Use @since tags
@@ -168,11 +162,12 @@ Use @since tags for newly-added public API types and methods e.g.
168162

169163
## Submit JUnit test cases for all behavior changes
170164

171-
Search the codebase to find related unit tests and add additional @Test methods within. It is also acceptable to submit test cases on a per issue basis.
165+
Search the codebase to find related unit tests and add additional `@Test` methods within. It is also acceptable to submit test cases on a per issue basis.
172166

173167
## Squash commits
174168

175-
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.
169+
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,
170+
there are many resources online to help you understand how these tools work. Here is one: [https://git-scm.com/docs/git-rebase#_interactive_mode](https://git-scm.com/docs/git-rebase#_interactive_mode).
176171

177172
## Use your real name in git commits
178173

@@ -191,9 +186,9 @@ You can configure this globally via the account admin area GitHub (useful for fo
191186
git config --global user.name "First Last"
192187
git config --global user.email [email protected]
193188

194-
or locally for the *spring-batch-extensions repository only by omitting the '--global' flag:
189+
or locally for the *spring-batch-extensions* repository only by omitting the '--global' flag:
195190

196-
cd spring-batch
191+
cd spring-batch-extensions
197192
git config user.name "First Last"
198193
git config user.email [email protected]
199194

@@ -205,6 +200,6 @@ Make sure that all tests pass prior to submitting your pull request.
205200

206201
Add a comment to the associated [GitHub Issue Tracker][] issue(s) linking to your new pull request.
207202

208-
[help documentation]: https://help.github.com/send-pull-requests
203+
[help documentation]: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
209204
[GitHub Issue Tracker]: https://github.com/spring-projects/spring-batch-extensions/issues
210205

0 commit comments

Comments
 (0)