From 6467e8d0b396495accae2019619f2aca55c8c392 Mon Sep 17 00:00:00 2001 From: lemoncurry Date: Mon, 19 Aug 2019 08:29:01 +0200 Subject: [PATCH 1/4] Create stub template, change POLICIES.md/CONTRIBUTING.md --- CONTRIBUTING.md | 12 +++++++----- POLICIES.md | 4 ++-- _template/src/main/java/StubTemplate.java | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 _template/src/main/java/StubTemplate.java diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0138dfa6..6e9ea70dd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ ## Overview -This guide covers contributing to the Java track. If you are new, this guide is for you. +This guide covers contributing to the Java track. If you are new to the exercism Java track, this guide is for you. If, at any point, you're having any trouble, pop in the [Gitter exercism/java room](https://gitter.im/exercism/java) or the [Gitter exercism/dev room](https://gitter.im/exercism/dev) for help. @@ -25,11 +25,13 @@ For general guidelines about contributing to Exercism see the [Exercism contribu Hi! Thanks for contributing to the Exercism Java track! -Before opening your pull request, please review the [track policies](https://github.com/exercism/java/blob/master/POLICIES.md) and make sure your changes comply with them all. This helps us focus our review time on the more important aspects of your changes. +Before opening your pull request, please review the [track policies](https://github.com/exercism/java/blob/master/POLICIES.md) and make sure your changes comply with them all. +This helps us focus our review time on the more important aspects of your contributions. -Also please only address one issue per 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. +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. -It's perfectly fine to have more than one pull request open at a time. 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. +It's perfectly fine to have more than one pull request open at a time. +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. 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. @@ -93,7 +95,7 @@ Each problem/submodule has three source sets: * `src/test/java/` — a test suite defining the edges of the problem * `.meta/src/reference/java/` — a reference solution that passes all the tests -* `src/main/java/` — starter source files, if required/desired *(this directory usually only has a `.keep` file in it)*. +* `src/main/java/` — starter source file(s). ---- diff --git a/POLICIES.md b/POLICIES.md index 054538a5e..3a31d425d 100644 --- a/POLICIES.md +++ b/POLICIES.md @@ -36,9 +36,9 @@ References: [[1](https://github.com/exercism/java/issues/177#issuecomment-261291 > - Exercises of difficulty 4 or lower: provide stubs for all required constructors and methods. This means that you need to provide stubs for those constructors or methods that are necessary to pass all tests. E.g. stubs for private methods may be skipped. Stubs should include the following body: `throw new UnsupportedOperationException("Delete this statement and write your own implementation.");` -> - Exercises of difficulty 5 or higher: provide no stubs by default, but either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. +> - Exercises of difficulty 5 or higher: provide a starter file only (StubTemplate.java) and rename it, but either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. -References: [[1](https://github.com/exercism/java/issues/178)], [[2](https://github.com/exercism/java/pull/683#discussion_r125506930)], [[3](https://github.com/exercism/java/issues/977)] +References: [[1](https://github.com/exercism/java/issues/178)], [[2](https://github.com/exercism/java/pull/683#discussion_r125506930)], [[3](https://github.com/exercism/java/issues/977)], [[4](https://github.com/exercism/java/issues/1721)] ### Avoid using final diff --git a/_template/src/main/java/StubTemplate.java b/_template/src/main/java/StubTemplate.java new file mode 100644 index 000000000..6178f1beb --- /dev/null +++ b/_template/src/main/java/StubTemplate.java @@ -0,0 +1,10 @@ +/* + +Since this exercise has a difficulty of > 4 it doesn't come +with any starter implementation. +This is so that you get to practice creating classes and methods +which is an important part of programming in Java. + +Please remove this comment when submitting your solution. + +*/ From f567c775e0a0ac703554fafdfb321e99b576ebca Mon Sep 17 00:00:00 2001 From: Anna Weber Date: Wed, 21 Aug 2019 08:28:10 +0200 Subject: [PATCH 2/4] Update POLICIES.md Co-Authored-By: Logan Stucki --- POLICIES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/POLICIES.md b/POLICIES.md index 3a31d425d..7d598412f 100644 --- a/POLICIES.md +++ b/POLICIES.md @@ -36,7 +36,7 @@ References: [[1](https://github.com/exercism/java/issues/177#issuecomment-261291 > - Exercises of difficulty 4 or lower: provide stubs for all required constructors and methods. This means that you need to provide stubs for those constructors or methods that are necessary to pass all tests. E.g. stubs for private methods may be skipped. Stubs should include the following body: `throw new UnsupportedOperationException("Delete this statement and write your own implementation.");` -> - Exercises of difficulty 5 or higher: provide a starter file only (StubTemplate.java) and rename it, but either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. +> - Exercises of difficulty 5 or higher: provide a starter file without stubs (StubTemplate.java) and rename it, and either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. References: [[1](https://github.com/exercism/java/issues/178)], [[2](https://github.com/exercism/java/pull/683#discussion_r125506930)], [[3](https://github.com/exercism/java/issues/977)], [[4](https://github.com/exercism/java/issues/1721)] From 9ee65bf2a18c1c49c9f5fb97b8d1865073580ed7 Mon Sep 17 00:00:00 2001 From: lemoncurry Date: Sat, 31 Aug 2019 10:26:34 +0200 Subject: [PATCH 3/4] POLICIES.md: add link to StubTemplate.java --- POLICIES.md | 2 +- _template/src/main/java/.keep | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 _template/src/main/java/.keep diff --git a/POLICIES.md b/POLICIES.md index 7d598412f..9b5c5e759 100644 --- a/POLICIES.md +++ b/POLICIES.md @@ -36,7 +36,7 @@ References: [[1](https://github.com/exercism/java/issues/177#issuecomment-261291 > - Exercises of difficulty 4 or lower: provide stubs for all required constructors and methods. This means that you need to provide stubs for those constructors or methods that are necessary to pass all tests. E.g. stubs for private methods may be skipped. Stubs should include the following body: `throw new UnsupportedOperationException("Delete this statement and write your own implementation.");` -> - Exercises of difficulty 5 or higher: provide a starter file without stubs (StubTemplate.java) and rename it, and either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. +> - Exercises of difficulty 5 or higher: provide a starter file without stubs (StubTemplate.java file provided [here](https://github.com/exercism/java/tree/master/_template/src/main/java)) and rename it, and either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. References: [[1](https://github.com/exercism/java/issues/178)], [[2](https://github.com/exercism/java/pull/683#discussion_r125506930)], [[3](https://github.com/exercism/java/issues/977)], [[4](https://github.com/exercism/java/issues/1721)] diff --git a/_template/src/main/java/.keep b/_template/src/main/java/.keep deleted file mode 100644 index e69de29bb..000000000 From ab72a8ed794cf0b733bfac1bdff6c3b70813cb26 Mon Sep 17 00:00:00 2001 From: lemoncurry Date: Sat, 7 Sep 2019 12:49:19 +0200 Subject: [PATCH 4/4] POLICIES.md update --- POLICIES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/POLICIES.md b/POLICIES.md index 9b5c5e759..8b65c6ae4 100644 --- a/POLICIES.md +++ b/POLICIES.md @@ -36,7 +36,7 @@ References: [[1](https://github.com/exercism/java/issues/177#issuecomment-261291 > - Exercises of difficulty 4 or lower: provide stubs for all required constructors and methods. This means that you need to provide stubs for those constructors or methods that are necessary to pass all tests. E.g. stubs for private methods may be skipped. Stubs should include the following body: `throw new UnsupportedOperationException("Delete this statement and write your own implementation.");` -> - Exercises of difficulty 5 or higher: provide a starter file without stubs (StubTemplate.java file provided [here](https://github.com/exercism/java/tree/master/_template/src/main/java)) and rename it, and either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. +> - Exercises of difficulty 5 or higher: copy the StubTemplate.java file (provided [here](https://github.com/exercism/java/tree/master/_template/src/main/java)) and rename it to fit the exercise. For example, for the exercise linked-list the file could be named LinkedList.java. Then either (1) add hints to the hints.md file (which gets merged into the README.md for the exercise) or (2) provide stubs as above for exercises that demand complicated method signatures. References: [[1](https://github.com/exercism/java/issues/178)], [[2](https://github.com/exercism/java/pull/683#discussion_r125506930)], [[3](https://github.com/exercism/java/issues/977)], [[4](https://github.com/exercism/java/issues/1721)]