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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+33-28Lines changed: 33 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,24 @@
2
2
3
3
## Table of Contents
4
4
5
-
*[Overview](#overview)
6
-
*[Before Making Your Pull Request](#before-making-your-pull-request)
7
-
*[Contributing With Minimal Setup](#contributing-with-minimal-setup)
8
-
*[Getting Familiar With the Codebase](#getting-familiar-with-the-codebase)
9
-
*[The `exercises` Module](#the-exercises-module)
10
-
*[The Problem Submodules](#the-problem-submodules)
11
-
*[Advanced: Complete Local Setup](#advanced-complete-local-setup)
12
-
*[Tip: `gradle clean` before `exercism fetch`](#tip-gradle-clean-before-exercism-fetch)
13
-
*[Adding a New Exercise](#adding-a-new-exercise)
14
-
*[Updating the READMEs](#updating-the-readmes)
15
-
*[Checking tests are up to date](#checking-tests-are-up-to-date)
16
-
*[Checking tests are up to date and submit new issues](#checking-tests-are-up-to-date-and-submit-new-issues)
5
+
<!-- TOC -->
6
+
*[Overview](#overview)
7
+
*[Before Making Your Pull Request](#before-making-your-pull-request)
8
+
*[Contributing With Minimal Setup](#contributing-with-minimal-setup)
9
+
*[Contributing using Intellij IDEA](#contributing-using-intellij-idea)
10
+
*[Getting Familiar With the Codebase](#getting-familiar-with-the-codebase)
11
+
*[The `exercises` Module](#the-exercises-module)
12
+
*[The Problem Submodules](#the-problem-submodules)
13
+
*[Advanced: Complete Local Setup](#advanced--complete-local-setup)
14
+
*[Prerequisites](#prerequisites)
15
+
*[Debian Linux](#debian-linux)
16
+
*[macOS](#macos)
17
+
*[Adding a New Exercise](#adding-a-new-exercise)
18
+
*[Updating the READMEs](#updating-the-readmes)
19
+
*[Checking tests are up to date](#checking-tests-are-up-to-date)
20
+
*[Checking tests are up to date and submit new issues](#checking-tests-are-up-to-date-and-submit-new-issues)
21
+
*[Checking exercises are implemented and submit new issues](#checking-exercises-are-implemented-and-submit-new-issues)
22
+
<!-- TOC -->
17
23
18
24
## Overview
19
25
@@ -30,12 +36,12 @@ Hi! Thanks for contributing to the Exercism Java track!
30
36
Before opening your pull request, please review the [track policies](https://github.com/exercism/java/blob/main/POLICIES.md) and make sure your changes comply with them all.
31
37
This helps us focus our review time on the more important aspects of your contributions.
32
38
33
-
Also please only address one issue per pull request and reference the issue in your pull request. This makes it easier for us to review it, and it means that if we request changes to the fix for one issue, it won't prevent to a fix for another issue being merged.
39
+
Also, please only address one issue per pull request and reference the issue in your pull request. This makes it easier for us to review it, and it means that if we request changes to the fix for one issue, it won't prevent to a fix for another issue being merged.
34
40
35
41
It's perfectly fine to have more than one pull request open at a time.
36
42
In that case it's important to keep the work for each pull request on a separate [branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) to prevent unrelated commits being added to your pull request. This is good practice to do always, even if you only have one pull request open.
37
43
38
-
One last thing to note before you get started. When you fork the repository and you want to [sync your fork](https://help.github.com/articles/syncing-a-fork/), you can perform a [`git rebase`](https://git-scm.com/docs/git-rebase). This is preferred over merging the changes because merging leads to a dirty commit history whereas performing a rebase adds in those changes without making extra commit messages. However, this is only preferred, so don't worry about it too much.
44
+
One last thing to note before you get started. When you fork the repository, and you want to [sync your fork](https://help.github.com/articles/syncing-a-fork/), you can perform a [`git rebase`](https://git-scm.com/docs/git-rebase). This is preferred over merging the changes because merging leads to a dirty commit history whereas performing a rebase adds in those changes without making extra commit messages. However, this is only preferred, so don't worry about it too much.
39
45
40
46
## Contributing With Minimal Setup
41
47
@@ -46,7 +52,7 @@ To submit a fix for an existing exercise or port an exercise to Java with the le
46
52
1.**Ensure you have the basic Java tooling installed:** JDK 1.11+, an editor and Gradle 2.x.
47
53
48
54
(see [exercism.io: Installing Java](https://exercism.org/docs/tracks/java/installation))
49
-
-**Setup a branch on a fork of [exercism/java](https://github.com/exercism/java) on your computer.**
55
+
-**Set up a branch on a fork of [exercism/java](https://github.com/exercism/java) on your computer.**
50
56
51
57
See [GitHub Help: Forking](https://help.github.com/articles/fork-a-repo/). Use those instructions (in conjunction with the [Contributing via GitHub](https://github.com/exercism/docs/tree/main/building/github#contributing-via-github)) to:
52
58
* "fork" a repository on GitHub;
@@ -65,7 +71,7 @@ To submit a fix for an existing exercise or port an exercise to Java with the le
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing/git-basics.md#commit-messages) that provides practical advice on crafting meaningful commit messages.
74
+
The GitHub doc has a section on [pull requests](https://exercism.org/docs/building/github/contributors-pull-request-guide) that provides practical advices on how to create them.
69
75
-**Verify that your work passes all tests.** When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.
70
76
-**Check the style of your code**. Running `gradle check` from the root folder of the exercise, the checkstyle plugin will show you every style violation of your code
71
77
@@ -74,7 +80,7 @@ To submit a fix for an existing exercise or port an exercise to Java with the le
74
80
Intellij IDEA is one of the more popular IDEs when working with Java, and it includes several tools to help simplify the process. The following steps outline how to import the git repository, make changes, and push
75
81
them back to your fork (this is assuming you have already forked the repo...if you haven't, see the link about [forking](https://help.github.com/articles/fork-a-repo/)).
76
82
77
-
-**Open the IDE and import the project** From the startup menu, select "Check out from Version Control". This will open a dialog where you can enter in the URL of the git repository and specify the directory that you would
83
+
-**Open the IDE and import the project** From the startup menu, select "Check out from Version Control". This will open a dialog where you can enter the URL of the git repository and specify the directory that you would
78
84
like to clone the repo into.
79
85
80
86

@@ -91,7 +97,7 @@ like to clone the repo into.
91
97
92
98

93
99
94
-
-**Create a feature branch** The git tools in IDEA are located in the VCS menu. To createa a new branch, select VCS > Git > Branches and then click "New Branch". Give the branch a meaningful name and create.
100
+
-**Create a feature branch** The git tools in IDEA are located in the VCS menu. To create a new branch, select VCS > Git > Branches and then click "New Branch". Give the branch a meaningful name and create.
95
101
96
102

97
103

@@ -103,8 +109,8 @@ open the Tasks > Verification folder and double click `test`
103
109
104
110

105
111
106
-
-**Commit/Merge changes** Once all of the changes have been made, you can look at the diffs and commit from the "Commit File" window, which can be reached by selecting VCS > Git > Commit File from the top menu.
107
-
If all of the changes are acceptable, checkmark all of the files that are to be committed, enter a meaningful commit message, and then click "Commit and Push".
112
+
-**Commit/Merge changes** Once all the changes have been made, you can look at the diffs and commit from the "Commit File" window, which can be reached by selecting VCS > Git > Commit File from the top menu.
113
+
If all the changes are acceptable, checkmark all the files that are to be committed, enter a meaningful commit message, and then click "Commit and Push".
108
114
109
115

110
116
@@ -123,14 +129,14 @@ This repo is a multi-project gradle build.
123
129
124
130
### The `exercises` Module
125
131
126
-
This is the top-level module, contained in the `exercises` directory. It is a container for the problem sub-modules.
132
+
This is the top-level module, contained in the `exercises` directory. It is a container for the problem submodules.
127
133
128
134
* its `build.gradle` points the "main" sourceset to the reference solution.
129
135
* its `settings.gradle` names each of the subprojects, one for each problem in the set.
130
136
131
137
### The Problem Submodules
132
138
133
-
The `exercises` subdirectory contains all of the problem submodules.
139
+
The `exercises` subdirectory contains all the problem submodules.
134
140
Each problem/submodule is a subdirectory of the same name as its slug.
135
141
136
142
* its `build.gradle` names dependencies required to work that problem.
@@ -155,20 +161,19 @@ Before you proceed, please ensure that you have `jq` (library that parses JSON)
155
161
#### macOS
156
162
`brew install jq ruby`
157
163
158
-
If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local install of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.
164
+
If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local installation of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.
159
165
160
166
The easiest way to achieve this is simply use the `bin/journey-test.sh` script. However, you may want to perform other tests, depending on what you are doing. You can do so by duplicating the setup performed by the `bin/journey-test.sh` script.
161
167
162
168
## Adding a New Exercise
163
169
164
170
The easiest way to add a new exercise to the Java track is to port an exercise from another track.
165
-
That means that you take an exercise that has already been implemented in another language and you implement it in this track.
171
+
That means that you take an exercise that has already been implemented in another language, and you implement it in this track.
166
172
167
173
To add a completely new exercise you need to open a pull request to the [problem specifications repository](https://github.com/exercism/problem-specifications/tree/main/exercises).
168
174
Any completely new exercise needs to be added and accepted there before it can be added to the Java track.
169
175
170
-
There is a [general Exercism guide for porting an exercise to a new language](https://github.com/exercism/docs/blob/master/you-can-help/implement-an-exercise-from-specification.md).
171
-
Please review this before porting an exercise to the Java track.
176
+
Before porting an exercise to the Java track, please review the [concept exercises guide](https://exercism.org/docs/building/tracks/concept-exercises) and/or the [practice exercise guide](https://exercism.org/docs/building/tracks/practice-exercises).
172
177
173
178
Please make sure no one else has a pull request open to implement your chosen exercise before you start.
174
179
@@ -177,7 +182,7 @@ This can just be a pull request with an empty commit that states which new exerc
177
182
178
183
The Java specific details you need to know about adding an exercise are:
179
184
180
-
* Please add an entry to the `exercises` array in `config.json`. You can find details about what should be in that entry [here](https://github.com/exercism/docs/blob/master/language-tracks/configuration/exercises.md).
185
+
* Please add an entry to the `exercises` array in `config.json`. You can find details about what should be in that entry [here](https://exercism.org/docs/building/tracks/config-json).
181
186
You can also look at other entries in `config.json` as examples and try to mimic them.
182
187
183
188
* Please add an entry for your exercise to `settings.gradle`.
@@ -208,7 +213,7 @@ See other exercises, e.g. [acronym](https://github.com/exercism/java/tree/main/e
208
213
* Make sure you've followed the [track policies](https://github.com/exercism/java/blob/main/POLICIES.md), especially the ones for exercise added/updated.
209
214
210
215
Hopefully that should be enough information to help you port an exercise to the Java track.
211
-
Feel free to open an issue or post in the [Building Exercism](https://forum.exercism.org/c/exercism/building-exercism/125) category of the [Exercism forum](https://forum.exercism.org/) if you have any questions and we'll try and answer as soon as we can.
216
+
Feel free to open an issue or post in the [Building Exercism](https://forum.exercism.org/c/exercism/building-exercism/125) category of the [Exercism forum](https://forum.exercism.org/) if you have any questions, and we'll try and answer as soon as we can.
0 commit comments