trackler 2.1.0.27 → 2.1.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/CONTRIBUTING.md +9 -349
- data/common/exercises/forth/canonical-data.json +1 -7
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/config.json +5 -0
- data/tracks/bash/exercises/anagram/anagram_tests.sh +99 -0
- data/tracks/bash/exercises/anagram/example.sh +23 -0
- data/tracks/delphi/config.json +8 -1
- data/tracks/delphi/exercises/two-fer/twofer.dpr +60 -0
- data/tracks/delphi/exercises/two-fer/utwoferExample.pas +17 -0
- data/tracks/delphi/exercises/two-fer/utwoferTest.pas +71 -0
- data/tracks/dlang/README.md +9 -5
- data/tracks/dlang/bin/test-exercise +14 -5
- data/tracks/dlang/docs/INSTALLATION.md +24 -0
- data/tracks/dlang/docs/TESTS.md +6 -6
- data/tracks/dlang/exercises/bob/dub.sdl +2 -0
- data/tracks/dlang/exercises/bob/{bob_example.d → example/bob.d} +0 -5
- data/tracks/dlang/exercises/bob/{bob.d → source/bob.d} +0 -5
- data/tracks/dlang/exercises/circular-buffer/dub.sdl +2 -0
- data/tracks/dlang/exercises/circular-buffer/{circular_buffer_example.d → example/circular_buffer.d} +0 -5
- data/tracks/dlang/exercises/circular-buffer/{circular_buffer.d → source/circular_buffer.d} +0 -5
- data/tracks/dlang/exercises/crypto-square/dub.sdl +2 -0
- data/tracks/dlang/exercises/crypto-square/{crypto_square_example.d → example/crypto_square.d} +0 -5
- data/tracks/dlang/exercises/crypto-square/{crypto_square.d → source/crypto_square.d} +0 -5
- data/tracks/dlang/exercises/difference-of-squares/dub.sdl +2 -0
- data/tracks/dlang/exercises/difference-of-squares/{difference_of_squares_example.d → example/difference_of_squares.d} +0 -2
- data/tracks/dlang/exercises/difference-of-squares/{difference_of_squares.d → source/difference_of_squares.d} +0 -2
- data/tracks/dlang/exercises/etl/dub.sdl +2 -0
- data/tracks/dlang/exercises/etl/{etl_example.d → example/etl.d} +0 -5
- data/tracks/dlang/exercises/etl/{etl.d → source/etl.d} +0 -5
- data/tracks/dlang/exercises/gigasecond/dub.sdl +2 -0
- data/tracks/dlang/exercises/gigasecond/{gigasecond_example.d → example/gigasecond.d} +0 -2
- data/tracks/dlang/exercises/gigasecond/{gigasecond.d → source/gigasecond.d} +0 -2
- data/tracks/dlang/exercises/hamming/dub.sdl +2 -0
- data/tracks/dlang/exercises/hamming/{hamming_example.d → example/hamming.d} +0 -5
- data/tracks/dlang/exercises/hamming/{hamming.d → source/hamming.d} +0 -5
- data/tracks/dlang/exercises/hello-world/dub.sdl +2 -0
- data/tracks/dlang/exercises/hello-world/{hello_world_example.d → example/hello_world.d} +0 -2
- data/tracks/dlang/exercises/hello-world/{hello_world.d → source/hello_world.d} +0 -0
- data/tracks/dlang/exercises/leap/dub.sdl +2 -0
- data/tracks/dlang/exercises/leap/{leap_example.d → example/leap.d} +0 -2
- data/tracks/dlang/exercises/leap/{leap.d → source/leap.d} +0 -2
- data/tracks/dlang/exercises/nucleotide-count/dub.sdl +2 -0
- data/tracks/dlang/exercises/nucleotide-count/{nucleotide_count_example.d → example/nucleotide_count.d} +0 -4
- data/tracks/dlang/exercises/nucleotide-count/{nucleotide_count.d → source/nucleotide_count.d} +0 -4
- data/tracks/dlang/exercises/pangram/dub.sdl +2 -0
- data/tracks/dlang/exercises/pangram/{pangram_example.d → example/pangram.d} +0 -2
- data/tracks/dlang/exercises/pangram/{pangram.d → source/pangram.d} +0 -2
- data/tracks/dlang/exercises/raindrops/dub.sdl +2 -0
- data/tracks/dlang/exercises/raindrops/{raindrops_example.d → example/raindrops.d} +0 -2
- data/tracks/dlang/exercises/raindrops/{raindrops.d → source/raindrops.d} +0 -2
- data/tracks/dlang/exercises/react/dub.sdl +2 -0
- data/tracks/dlang/exercises/react/{react_example.d → example/react.d} +0 -2
- data/tracks/dlang/exercises/react/{react.d → source/react.d} +0 -2
- data/tracks/dlang/exercises/rna-transcription/dub.sdl +2 -0
- data/tracks/dlang/exercises/rna-transcription/{rna_transcription_example.d → example/rna_transcription.d} +0 -2
- data/tracks/dlang/exercises/rna-transcription/{rna_transcription.d → source/rna_transcription.d} +0 -2
- data/tracks/dlang/exercises/robot-name/dub.sdl +2 -0
- data/tracks/dlang/exercises/robot-name/{robot_name_example.d → example/robot_name.d} +0 -5
- data/tracks/dlang/exercises/robot-name/{robot_name.d → source/robot_name.d} +0 -4
- data/tracks/dlang/exercises/roman-numerals/dub.sdl +2 -0
- data/tracks/dlang/exercises/roman-numerals/{roman_numerals_example.d → example/roman_numerals.d} +0 -4
- data/tracks/dlang/exercises/roman-numerals/{roman_numerals.d → source/roman_numerals.d} +0 -4
- data/tracks/dlang/exercises/series/dub.sdl +2 -0
- data/tracks/dlang/exercises/series/{series_example.d → example/series.d} +0 -5
- data/tracks/dlang/exercises/series/{series.d → source/series.d} +0 -5
- data/tracks/dlang/exercises/triangle/dub.sdl +2 -0
- data/tracks/dlang/exercises/triangle/{triangle_example.d → example/triangle.d} +0 -5
- data/tracks/dlang/exercises/triangle/{triangle.d → source/triangle.d} +0 -5
- data/tracks/elisp/.github/stale.yml +0 -0
- data/tracks/elisp/exercises/grains/grains-test.el +12 -12
- data/tracks/elisp/exercises/robot-name/robot-name-test.el +8 -19
- data/tracks/elisp/exercises/word-count/word-count-test.el +27 -27
- data/tracks/fortran/Makefile +3 -2
- data/tracks/fortran/config.json +21 -2
- data/tracks/fortran/exercises/difference-of-squares/difference_of_squares.fun +42 -0
- data/tracks/fortran/exercises/difference-of-squares/example.f90 +35 -0
- data/tracks/fortran/exercises/{hello_world → hello-world}/example.f90 +0 -0
- data/tracks/fortran/exercises/{hello_world → hello-world}/hello_world.fun +0 -0
- data/tracks/fortran/exercises/raindrops/example.f90 +26 -0
- data/tracks/fortran/exercises/raindrops/raindrops.fun +78 -0
- data/tracks/fortran/exercises/rna-transcription/example.f90 +27 -0
- data/tracks/fortran/exercises/rna-transcription/rna_transcription.fun +38 -0
- data/tracks/go/exercises/acronym/.meta/gen.go +51 -0
- data/tracks/go/exercises/acronym/acronym_test.go +1 -15
- data/tracks/go/exercises/acronym/cases_test.go +37 -0
- data/tracks/go/exercises/acronym/example.go +1 -1
- data/tracks/go/exercises/secret-handshake/.meta/gen.go +49 -0
- data/tracks/go/exercises/secret-handshake/cases_test.go +24 -0
- data/tracks/go/exercises/secret-handshake/example.go +1 -1
- data/tracks/go/exercises/secret-handshake/secret_handshake_test.go +1 -17
- data/tracks/java/config.json +23 -23
- data/tracks/java/exercises/book-store/src/example/java/{Bookstore.java → BookStore.java} +5 -12
- data/tracks/java/exercises/book-store/src/test/java/BookStoreTest.java +113 -0
- data/tracks/java/exercises/saddle-points/src/example/java/Matrix.java +5 -4
- data/tracks/java/exercises/saddle-points/src/example/java/MatrixCoordinate.java +5 -5
- data/tracks/java/exercises/saddle-points/src/main/java/MatrixCoordinate.java +5 -5
- data/tracks/java/exercises/saddle-points/src/test/java/MatrixTest.java +10 -10
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/hamming/bower.json +16 -0
- data/tracks/purescript/exercises/hamming/examples/src/Hamming.purs +14 -0
- data/tracks/purescript/exercises/hamming/test/Main.purs +46 -0
- data/tracks/scala/config.json +7 -0
- data/tracks/scala/exercises/bob/example.scala +3 -3
- data/tracks/scala/exercises/bob/src/main/scala/Bob.scala +2 -2
- data/tracks/scala/exercises/bob/src/test/scala/BobTest.scala +83 -53
- data/tracks/scala/exercises/book-store/build.sbt +3 -0
- data/tracks/scala/exercises/book-store/example.scala +49 -0
- data/tracks/scala/exercises/book-store/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/book-store/src/test/scala/BookStoreTest.scala +70 -0
- data/tracks/scala/exercises/difference-of-squares/example.scala +3 -3
- data/tracks/scala/exercises/difference-of-squares/src/main/scala/DifferenceOfSquares.scala +8 -0
- data/tracks/scala/exercises/difference-of-squares/src/test/scala/DifferenceOfSquaresTest.scala +49 -0
- data/tracks/scala/exercises/leap/example.scala +4 -3
- data/tracks/scala/exercises/leap/src/main/scala/Leap.scala +2 -2
- data/tracks/scala/exercises/leap/src/test/scala/LeapTest.scala +12 -20
- data/tracks/scala/exercises/raindrops/src/test/scala/RaindropsTest.scala +46 -35
- data/tracks/scala/testgen/src/main/scala/BobTestGenerator.scala +15 -0
- data/tracks/scala/testgen/src/main/scala/BookStoreTestGenerator.scala +15 -0
- data/tracks/scala/testgen/src/main/scala/DifferenceOfSquaresTestGenerator.scala +17 -0
- data/tracks/scala/testgen/src/main/scala/LeapTestGenerator.scala +15 -0
- data/tracks/scala/testgen/src/main/scala/RaindropsTestGenerator.scala +15 -0
- data/tracks/vimscript/config.json +5 -0
- data/tracks/vimscript/exercises/triangle/example.vim +28 -0
- data/tracks/vimscript/exercises/triangle/triangle.vader +92 -0
- data/tracks/vimscript/exercises/triangle/triangle.vim +24 -0
- metadata +93 -44
- data/tracks/java/exercises/book-store/src/test/java/BookstoreTest.java +0 -119
- data/tracks/scala/exercises/difference-of-squares/src/main/scala/Squares.scala +0 -8
- data/tracks/scala/exercises/difference-of-squares/src/test/scala/SquaresTest.scala +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22277589d4cc0a204319b33cc82d7a7c0dac30b4
|
4
|
+
data.tar.gz: 97204abac4f271dbe405bd4fd0f87dea116478b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b5e630d56cdd344ec4b8f6e8003979a0bc82271373f95fe670d75f2ce4349e167ff6be6239492808859d29e007a502e8c1ec510a3bdafac55c38be864f7e389
|
7
|
+
data.tar.gz: 8a1af1baa53f7457fcb6f2c1c87448d3573328554dcaf9ccbff79dad66632d1bffb5db3598e93369efe7668470462b2e84ce1127bd4f79ef49dec402680e603d
|
data/common/CONTRIBUTING.md
CHANGED
@@ -27,11 +27,9 @@ themselves. There are other guides about contributing to other parts of the Exer
|
|
27
27
|
* [Overview](#overview)
|
28
28
|
* [Updating an Exercise Test Suite](#updating-an-exercise-test-suite)
|
29
29
|
* [Updating a Generated Test Suite](#updating-a-generated-test-suite)
|
30
|
-
* [Tweaking a README](#tweaking-a-readme)
|
31
30
|
* [Porting an Exercise to Another Language Track](#porting-an-exercise-to-another-language-track)
|
32
31
|
* [Providing Feedback on the Site for an Exercise You Implemented](#providing-feedback-on-the-site-for-an-exercise-you-implemented)
|
33
32
|
* [Implementing a Completely New Exercise](#implementing-a-completely-new-exercise)
|
34
|
-
* [Improving Consistency By Extracting Shared Test Data](#improving-consistency-by-extracting-shared-test-data)
|
35
33
|
* [Track Anatomy](#track-anatomy)
|
36
34
|
* [Starting a New Track](#starting-a-new-track)
|
37
35
|
* [Beta-Testing a Language Track](#beta-testing-a-language-track)
|
@@ -43,12 +41,7 @@ themselves. There are other guides about contributing to other parts of the Exer
|
|
43
41
|
* [Track configuration file (config.json)](#track-configuration-file)
|
44
42
|
* [Track-Level Linting With Configlet](#track-level-linting-with-configlet)
|
45
43
|
* [Git Basics](#git-basics)
|
46
|
-
|
47
|
-
* [Branches](#branches)
|
48
|
-
* [Commit Messages](#commit-messages)
|
49
|
-
* [Resetting `master`](#resetting-master)
|
50
|
-
* [Squashing](#squashing)
|
51
|
-
* [Resources](#resources)
|
44
|
+
[Improving Consistency By Extracting Shared Test Data](#improving-consistency-by-extracting-shared-test-data)
|
52
45
|
|
53
46
|
## We Will Gladly Help You Help Us
|
54
47
|
|
@@ -226,69 +219,6 @@ Follow the guidelines for setting up a development environment, verifying the ch
|
|
226
219
|
and submitting a pull request, as described in the [main section about updating an
|
227
220
|
exercise test suite](#updating-an-exercise-test-suite).
|
228
221
|
|
229
|
-
## Tweaking a README
|
230
|
-
|
231
|
-
The Exercism exercise README treads a very fine line between useful ambiguity and confusing
|
232
|
-
vagueness. Because the README is the same whether you're solving the problem in C++ or in Lua,
|
233
|
-
the problem description needs to be high-level enough to allow for the syntactic, semantic, and
|
234
|
-
philosophical differences in the various languages.
|
235
|
-
|
236
|
-
In other words: no specific references to syntax or data structures of a specific language
|
237
|
-
can be used to further clarify a problem.
|
238
|
-
|
239
|
-
However, within this purposeful ambiguity might lie some opportunities for making an exercise
|
240
|
-
description more clear. Typical issues to be attentive to:
|
241
|
-
|
242
|
-
- poorly worded sentences
|
243
|
-
- outdated information
|
244
|
-
- incorrect directives
|
245
|
-
- typos
|
246
|
-
|
247
|
-
Each language's test suite provides the precise specification for the
|
248
|
-
exercise, which allows the user to view the problem from a perspective that is
|
249
|
-
interesting and idiomatic for that specific language.
|
250
|
-
|
251
|
-
In addition, there's some language-specific content that gets woven into
|
252
|
-
the README, usually a quick reminder about how to run the tests, and
|
253
|
-
where to find more documentation.
|
254
|
-
|
255
|
-
### Updating a Generic Problem Description
|
256
|
-
|
257
|
-
[Fork this repository](https://github.com/exercism/x-common/fork).
|
258
|
-
|
259
|
-
Each generic problem is identified by a slug. For example, the problem _Crypto
|
260
|
-
Square_ is `crypto-square`. There are two metadata files for each problem:
|
261
|
-
|
262
|
-
* `exercises/<slug>/description.md` which contains the generic problem description which makes up
|
263
|
-
the bulk of the README, and
|
264
|
-
* `exercises/<slug>/metadata.yml` which contains a short one-line description of the problem as
|
265
|
-
well as other metadata, such as the source that inspired the problem in the
|
266
|
-
first place.
|
267
|
-
|
268
|
-
There aren't any rules about what a good exercism problem README looks like.
|
269
|
-
If in doubt, [open up a GitHub issue](https://github.com/exercism/x-common/issues/new)
|
270
|
-
describing your suggestion.
|
271
|
-
|
272
|
-
Once you've made your change [submit a pull
|
273
|
-
request](#pull-request-guidelines).
|
274
|
-
|
275
|
-
### Updating Language-Specific Additions
|
276
|
-
|
277
|
-
Each language track may optionally contain a `SETUP.md` file in the root of
|
278
|
-
the repository. This file should contain helpful, generic information about
|
279
|
-
solving an exercism problem in the target language.
|
280
|
-
|
281
|
-
The contents of the `SETUP.md` file gets included in the README.md that gets
|
282
|
-
delivered along with the test suite and any supporting files when a user runs
|
283
|
-
the `exercism fetch` command from their terminal.
|
284
|
-
|
285
|
-
It would also be useful to explain in a generic way how to run the tests.
|
286
|
-
Remember that this file will be included with _all_ the problems, so it gets
|
287
|
-
confusing if we refer to specific problems or files.
|
288
|
-
|
289
|
-
If a language track has specific expectations, these should also be documented
|
290
|
-
here.
|
291
|
-
|
292
222
|
## Porting an Exercise to Another Language Track
|
293
223
|
|
294
224
|
To get a list of all the exercises that can be ported to a track,
|
@@ -384,25 +314,6 @@ A problem must have a unique slug. This slug is used as
|
|
384
314
|
Reference the PR in x-common if it hasn't been merged yet,
|
385
315
|
this **must not** be merged until the exercism/x-common PR is merged.
|
386
316
|
|
387
|
-
## Improving Consistency By Extracting Shared Test Data
|
388
|
-
The goal is to have a file `exercises/<slug>/canonical-data.json` for each exercise in this repository. This JSON file should contain the generic (i.e. language independent) test data for that exercise. With this the quality of the tracks can be improved, e.g. fixes or new tests can be propagated to all the tracks. They can then be implemented manually or by running the test generator. (See [this issue](https://github.com/exercism/todo/issues/13) for more background info.)
|
389
|
-
|
390
|
-
The following steps help you extracting the canonical test data.
|
391
|
-
|
392
|
-
1. Select the exercise for which you want to create the shared test data from the [list of open todos](https://github.com/exercism/todo/issues?q=is%3Aissue+is%3Aopen+label%3Ashared-test-data)
|
393
|
-
2. Now you need to find the existing tests. You can get a list with links to the all of those one of two ways
|
394
|
-
* Search for the exercise in this list http://x.exercism.io/v3/problems/data-todos (your browser might need a JSON viewer plugin/add-on to show this)
|
395
|
-
* Run this command in your terminal `curl http://x.exercism.io/v3/problems/data-todos | jq '.[] | map(select(.["slug"] == "accumulate"))'`. Replace `accumulate` with the name of the exercise you have chosen.
|
396
|
-
3. Open the links in different browser tabs, navigate to the test files and read through the tests. Look for test cases that all/many of the languages have in common and identify outliers that only appear in one or two languages. It might be helpful to make some notes on your findings.
|
397
|
-
4. Now it's time to write the canonical-data.json file. Look at examples like [the test data for hamming](https://github.com/exercism/x-common/blob/master/exercises/hamming/canonical-data.json) and check the [readme](https://github.com/exercism/x-common#test-data-format-canonical-datajson) to find out how to best structure the JSON file.
|
398
|
-
From what you learned in step 3 decide for a sensible set of test cases. The following considerations might help with that.
|
399
|
-
* Try to stick to test cases that already occur in many languages so it is feasible for the track maintainers to adapt to the canonical set.
|
400
|
-
* All tests should be essential to the problem. Ensure people can get the first test passing easily. Then each following test should ideally add a little functionality. People should be able to solve the problem a little at a time. Avoid test cases that don't introduce any new aspect and would already pass anyway.
|
401
|
-
* The test cases should not require people to follow one very specific way to solve the problem, e.g. the tests should avoid checking for helper functions that might not be present in other implementations.
|
402
|
-
* Performance tests should not be included in the canonical test data.
|
403
|
-
|
404
|
-
If you are unsure about all these considerations just make a pull request with an initial proposal and ask the community for help.
|
405
|
-
|
406
317
|
## Track Anatomy
|
407
318
|
|
408
319
|
Each track should have the following structure:
|
@@ -692,265 +603,7 @@ Optional keys:
|
|
692
603
|
* `solution_pattern` - A (case sensitive) regex pattern that matches solution files in the track repository. Used by [configlet](https://github.com/exercism/configlet) to check for the presence of an example solution for each problem implemented by the track. The default value used if this key is not present is `[Ee]xample`.
|
693
604
|
|
694
605
|
### Git Basics
|
695
|
-
|
696
|
-
If you're concerned that you haven't done it right, don't worry. Submit your pull request, and we'll help you get the details sorted out.
|
697
|
-
|
698
|
-
#### Getting the Code
|
699
|
-
|
700
|
-
We recommend forking the project first, and then cloning the fork.
|
701
|
-
|
702
|
-
```bash
|
703
|
-
git clone git@github.com:<YOUR_USERNAME>/<REPO_NAME>.git
|
704
|
-
```
|
705
|
-
|
706
|
-
This will give you a remote repository named `origin` that points to your own copy of the project.
|
707
|
-
|
708
|
-
In addition to this, we recommend that you add the original repository as a secondary remote.
|
709
|
-
|
710
|
-
```bash
|
711
|
-
git remote add upstream https://github.com/exercism/<REPO_NAME>.git
|
712
|
-
```
|
713
|
-
|
714
|
-
The names `origin` and `upstream` are pretty standard, so it's worth getting used to the names in your own work.
|
715
|
-
|
716
|
-
#### Branches
|
717
|
-
|
718
|
-
When working on your fork it tends to make things easier if you never touch the master branch.
|
719
|
-
|
720
|
-
The basic workflow becomes:
|
721
|
-
|
722
|
-
* check out the master branch
|
723
|
-
* pull from `upstream` to make sure everything is up to date
|
724
|
-
* push to `origin` so you have the latest code in your fork
|
725
|
-
* check out a branch
|
726
|
-
* make the changes, commit them
|
727
|
-
* rebase onto the upstream master (and resolve any conflicts)
|
728
|
-
* push your branch up to `origin`
|
729
|
-
* submit a pull request
|
730
|
-
|
731
|
-
If you're asked to tweak your work, you can keep pushing it to the branch, and it automatically updates the pull request with the new commits.
|
732
|
-
|
733
|
-
#### Commit Messages
|
734
|
-
|
735
|
-
Commit messages are communication and documentation. They're a log of more
|
736
|
-
than just _what_ happened, they're about _why_ it was done.
|
737
|
-
|
738
|
-
The longer a project is active, the more people involved, the larger the
|
739
|
-
codebase, the more important it is to have good commit messages.
|
740
|
-
|
741
|
-
There's an excellent lightning talk by Ryan Geary called [Do Your Commit
|
742
|
-
Messages
|
743
|
-
Suck?](https://www.youtube.com/watch?v=8YjSty6bfog).
|
744
|
-
It's funny and enlightening, and you should watch it.
|
745
|
-
|
746
|
-
Two articles that have very clear guidelines about how to write
|
747
|
-
excellent commit messages are Tim Pope's
|
748
|
-
[A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
749
|
-
and Chris Beams' [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).
|
750
|
-
Please read them.
|
751
|
-
|
752
|
-
##### Examples
|
753
|
-
|
754
|
-
Imagine that you're submitting a new problem called "spinning-wheel" to the Ruby track.
|
755
|
-
|
756
|
-
Here's a fairly typical set of commits that you might end up making:
|
757
|
-
|
758
|
-
```bash
|
759
|
-
433a0e1 added spinning wheel tests
|
760
|
-
1f7d4aa pass spinning wheel
|
761
|
-
cf21737 oops
|
762
|
-
be4c410 rename example file
|
763
|
-
bb89a77 update config
|
764
|
-
```
|
765
|
-
|
766
|
-
All of these commits are about a single thing: adding a new problem. They
|
767
|
-
should be a single commit. They don't have to start out that way (life is
|
768
|
-
messy), but once you're done, you should squash everything into one commit,
|
769
|
-
and rename it cohesively:
|
770
|
-
|
771
|
-
```bash
|
772
|
-
f4314e5 add spinning wheel problem
|
773
|
-
```
|
774
|
-
|
775
|
-
#### Resetting `master`
|
776
|
-
|
777
|
-
If you've already made changes on your master so that it has diverged from the
|
778
|
-
upstream you can reset it.
|
779
|
-
|
780
|
-
First create a backup of your branch so that you can find any changes. Just in
|
781
|
-
case.
|
782
|
-
|
783
|
-
```bash
|
784
|
-
git checkout master
|
785
|
-
git checkout -b backup
|
786
|
-
git checkout master
|
787
|
-
```
|
788
|
-
|
789
|
-
Next, fetch the most recent changes from the upstream repository and reset master to it.
|
790
|
-
|
791
|
-
```bash
|
792
|
-
git fetch upstream
|
793
|
-
git reset --hard upstream/master
|
794
|
-
```
|
795
|
-
|
796
|
-
If you do a git log at this point you'll see that you have *exactly* the
|
797
|
-
commits that are in the upstream repository. Your commits aren't gone, they're
|
798
|
-
just not in master anymore.
|
799
|
-
|
800
|
-
To put this on your GitHub fork, you'll probably need to use the `--force` flag:
|
801
|
-
|
802
|
-
```bash
|
803
|
-
git push --force origin master
|
804
|
-
```
|
805
|
-
|
806
|
-
#### Squashing
|
807
|
-
|
808
|
-
Squashing commits into a single commit is particularly useful when the change
|
809
|
-
happened in lots of little (sometimes confusing) steps, but it really is one
|
810
|
-
change.
|
811
|
-
|
812
|
-
There are a number of ways to accomplish this, and many people like to use an
|
813
|
-
[interactive rebase](#interactive-rebase), but it can be tricky if you haven't set git up to open
|
814
|
-
your favorite editor.
|
815
|
-
|
816
|
-
An easier way to do this is to un-commit everything, putting it back into the
|
817
|
-
staging area, and then committing it again.
|
818
|
-
|
819
|
-
Using the example from above, we have 5 commits that should be squashed into one.
|
820
|
-
|
821
|
-
```bash
|
822
|
-
433a0e1 added spinning wheel tests
|
823
|
-
1f7d4aa pass spinning wheel
|
824
|
-
cf21737 oops
|
825
|
-
be4c410 rename example file
|
826
|
-
bb89a77 update config
|
827
|
-
```
|
828
|
-
|
829
|
-
To un-commit them, use the following incantation:
|
830
|
-
|
831
|
-
```bash
|
832
|
-
$ git reset --soft HEAD^^^^^
|
833
|
-
```
|
834
|
-
|
835
|
-
Notice that there are 5 carets, one for each commit that you want to
|
836
|
-
un-commit. You could also say:
|
837
|
-
|
838
|
-
```bash
|
839
|
-
$ git reset --soft HEAD~5
|
840
|
-
```
|
841
|
-
|
842
|
-
If you do a `git status` now, you'll see all the changed files, and they're
|
843
|
-
staged and ready to commit. If you do a `git log`, you'll see that the most
|
844
|
-
recent commit is from someone else.
|
845
|
-
|
846
|
-
Next, commit, as usual:
|
847
|
-
|
848
|
-
```bash
|
849
|
-
$ git commit -m "Add spinning wheel problem"
|
850
|
-
```
|
851
|
-
|
852
|
-
Now if you do a `git status` you may get a warning saying that your origin and
|
853
|
-
your branch have diverged. This is completely normal, since the origin has 5
|
854
|
-
commits and you have 1 (different) one.
|
855
|
-
|
856
|
-
The next step is to force push this up to your branch, which will
|
857
|
-
automatically update the pull request, replacing the old commits with the new
|
858
|
-
one.
|
859
|
-
|
860
|
-
```bash
|
861
|
-
$ git push --force origin spinning-wheel
|
862
|
-
```
|
863
|
-
|
864
|
-
#### Resources
|
865
|
-
|
866
|
-
If you're completely new to git, there are a number of resources that can help
|
867
|
-
get you feeling more comfortable with it.
|
868
|
-
|
869
|
-
* [Git Immersion](http://gitimmersion.com/)
|
870
|
-
* [GitHug](https://github.com/Gazler/githug)
|
871
|
-
* [Try GitHub](http://try.github.io)
|
872
|
-
|
873
|
-
If you've been using git for a while, but it feels like repeating magical
|
874
|
-
incantations (while praying that nothing goes wrong), then you may find these
|
875
|
-
helpful:
|
876
|
-
|
877
|
-
* [Git for Ages 4 and Up](https://www.youtube.com/watch?v=1ffBJ4sVUb4) - video of a presentation/demo
|
878
|
-
* [Think Like a Git](http://think-like-a-git.net/)
|
879
|
-
* [Explain Git with D3](http://www.wei-wang.com/ExplainGitWithD3) - interactive site
|
880
|
-
* [Pro Git](http://git-scm.com/book/en/v2) - "The Book" for learning Git in detail
|
881
|
-
* [Git Branching Tutorial](http://pcottle.github.io/learnGitBranching/) - interactive tutorial, very visual
|
882
|
-
|
883
|
-
#### Rebasing
|
884
|
-
|
885
|
-
You'll often be asked to rebase your branch before we merge a pull request as Exercism likes to keep a linear project commit history. This is accomplished with git rebase. It takes the current branch and places all the commits at the front of the branch that you're rebasing with.
|
886
|
-
|
887
|
-
For example, rebasing the current branch on top of upstream/master:
|
888
|
-
```
|
889
|
-
git rebase upstream/master
|
890
|
-
```
|
891
|
-
Project commit history:
|
892
|
-
```
|
893
|
-
-- current branch --
|
894
|
-
/
|
895
|
-
--- master branch ----
|
896
|
-
```
|
897
|
-
|
898
|
-
##### Interactive Rebase
|
899
|
-
The rebase command has an option called `-i, --interactive` which will open an editor with a list of the commits which are about to be changed. This list accepts commands, allowing the user to edit the list before initiating the rebase action.
|
900
|
-
|
901
|
-
Using the example from above, we have 5 commits that should be squashed into one.
|
902
|
-
|
903
|
-
```bash
|
904
|
-
433a0e1 added spinning wheel tests
|
905
|
-
1f7d4aa pass spinning wheel
|
906
|
-
cf21737 oops
|
907
|
-
be4c410 rename example file
|
908
|
-
bb89a77 update config
|
909
|
-
```
|
910
|
-
|
911
|
-
To interactively rebase, use the following incantation:
|
912
|
-
|
913
|
-
```bash
|
914
|
-
$ git rebase -i HEAD~5
|
915
|
-
```
|
916
|
-
This will bring up an editor with the following information:
|
917
|
-
|
918
|
-
```bash
|
919
|
-
pick 433a0e1 added spinning wheel tests
|
920
|
-
pick 1f7d4aa pass spinning wheel
|
921
|
-
pick cf21737 oops
|
922
|
-
pick be4c410 rename example file
|
923
|
-
pick bb89a77 update config
|
924
|
-
|
925
|
-
#
|
926
|
-
# Commands:
|
927
|
-
# p, pick = use commit
|
928
|
-
# r, reword = use commit, but edit the commit message
|
929
|
-
# e, edit = use commit, but stop for amending
|
930
|
-
# s, squash = use commit, but meld into previous commit
|
931
|
-
# f, fixup = like "squash", but discard this commit's log message
|
932
|
-
# x, exec = run command (the rest of the line) using shell
|
933
|
-
#
|
934
|
-
# These lines can be re-ordered; they are executed from top to bottom.
|
935
|
-
#
|
936
|
-
# If you remove a line here THAT COMMIT WILL BE LOST.
|
937
|
-
#
|
938
|
-
# However, if you remove everything, the rebase will be aborted.
|
939
|
-
#
|
940
|
-
# Note that empty commits are commented out
|
941
|
-
```
|
942
|
-
|
943
|
-
By choosing the `reword` command for the top commit and choosing the `fixup` command for the remaining commits, you will be able to squash the commits into one commit and provide a descriptive summary of the entire change
|
944
|
-
|
945
|
-
```bash
|
946
|
-
reword 433a0e1 added spinning wheel tests
|
947
|
-
fixup 1f7d4aa pass spinning wheel
|
948
|
-
fixup cf21737 oops
|
949
|
-
fixup be4c410 rename example file
|
950
|
-
fixup bb89a77 update config
|
951
|
-
```
|
952
|
-
|
953
|
-
[Further Reading](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)
|
606
|
+
See [Git Basics](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md) in [docs](https://github.com/exercism/docs) repository.
|
954
607
|
|
955
608
|
### et cetera
|
956
609
|
|
@@ -958,3 +611,10 @@ TODO: add more sections:
|
|
958
611
|
|
959
612
|
- how to merge something locally (for example when there are conflicts, or
|
960
613
|
if you want to fix a small thing without nagging the contributor about it)
|
614
|
+
|
615
|
+
|
616
|
+
## Improving Consistency By Extracting Shared Test Data
|
617
|
+
|
618
|
+
This documentation has moved [to the docs repository](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/improving-consistency-across-tracks.md).
|
619
|
+
|
620
|
+
We are maintaining this section, since many open issues link to it.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"exercise": "forth",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.0",
|
4
4
|
"comments": [
|
5
5
|
"The cases are split into multiple sections, all with the same structure.",
|
6
6
|
"In all cases, the `expected` key is the resulting stack",
|
@@ -21,12 +21,6 @@
|
|
21
21
|
"property": "evaluate",
|
22
22
|
"input": ["1 2 3 4 5"],
|
23
23
|
"expected": [1, 2, 3, 4, 5]
|
24
|
-
},
|
25
|
-
{
|
26
|
-
"description": "all non-word characters are separators",
|
27
|
-
"property": "evaluate",
|
28
|
-
"input": ["1\u00002\u00133\n4\r5 6\t7"],
|
29
|
-
"expected": [1, 2, 3, 4, 5, 6, 7]
|
30
24
|
}
|
31
25
|
]
|
32
26
|
},
|
data/lib/trackler/version.rb
CHANGED
data/tracks/bash/config.json
CHANGED
@@ -0,0 +1,99 @@
|
|
1
|
+
#!/usr/bin/env bats
|
2
|
+
|
3
|
+
@test "no matches", {
|
4
|
+
run bash anagram.sh "diaper" "hello world zombies pants"
|
5
|
+
[ "$status" -eq 0 ]
|
6
|
+
[ "$output" = "" ]
|
7
|
+
}
|
8
|
+
|
9
|
+
@test "detects simple anagram" {
|
10
|
+
run bash anagram.sh "ant" "tan stand at"
|
11
|
+
[ "$status" -eq 0 ]
|
12
|
+
[ "$output" = "tan" ]
|
13
|
+
}
|
14
|
+
|
15
|
+
@test "does not detect false positives" {
|
16
|
+
run bash anagram.sh "galea" "eagle"
|
17
|
+
|
18
|
+
[ "$status" -eq 0 ]
|
19
|
+
[ "$output" = "" ]
|
20
|
+
}
|
21
|
+
@test "detects two anagrams" {
|
22
|
+
run bash anagram.sh "master" "stream pigeon maters"
|
23
|
+
|
24
|
+
[ "$status" -eq 0 ]
|
25
|
+
[ "$output" = "stream maters" ]
|
26
|
+
}
|
27
|
+
@test "does not detect anagram subsets" {
|
28
|
+
run bash anagram.sh "good" "dog goody"
|
29
|
+
|
30
|
+
[ "$status" -eq 0 ]
|
31
|
+
[ "$output" = "" ]
|
32
|
+
}
|
33
|
+
@test "detects anagram" {
|
34
|
+
run bash anagram.sh "listen" "enlists google inlets banana"
|
35
|
+
|
36
|
+
[ "$status" -eq 0 ]
|
37
|
+
[ "$output" = "inlets" ]
|
38
|
+
}
|
39
|
+
@test "detects three anagrams" {
|
40
|
+
run bash anagram.sh "allergy" "gallery ballerina regally clergy largely leading"
|
41
|
+
|
42
|
+
[ "$status" -eq 0 ]
|
43
|
+
[ "$output" = "gallery regally largely" ]
|
44
|
+
}
|
45
|
+
@test "does not detect identical words" {
|
46
|
+
run bash anagram.sh "corn" "corn dark Corn rank CORN cron park"
|
47
|
+
|
48
|
+
[ "$status" -eq 0 ]
|
49
|
+
[ "$output" = "cron" ]
|
50
|
+
}
|
51
|
+
@test "does not detect non-anagrams with identical checksum" {
|
52
|
+
run bash anagram.sh "mass" "last"
|
53
|
+
|
54
|
+
[ "$status" -eq 0 ]
|
55
|
+
[ "$output" = "" ]
|
56
|
+
}
|
57
|
+
@test "detects anagrams case-insensitively" {
|
58
|
+
run bash anagram.sh "Orchestra" "cashregister Carthorse radishes"
|
59
|
+
|
60
|
+
[ "$status" -eq 0 ]
|
61
|
+
[ "$output" = "Carthorse" ]
|
62
|
+
}
|
63
|
+
@test "detects anagrams using case-insensitive subject" {
|
64
|
+
run bash anagram.sh "Orchestra" "cashregister carthorse radishes"
|
65
|
+
|
66
|
+
[ "$status" -eq 0 ]
|
67
|
+
[ "$output" = "carthorse" ]
|
68
|
+
}
|
69
|
+
@test "detects anagrams using case-insensitive possible matches" {
|
70
|
+
run bash anagram.sh "orchestra" "cashregister Carthorse radishes"
|
71
|
+
|
72
|
+
[ "$status" -eq 0 ]
|
73
|
+
[ "$output" = "Carthorse" ]
|
74
|
+
}
|
75
|
+
@test "does not detect a word as its own anagram" {
|
76
|
+
run bash anagram.sh "banana" "Banana"
|
77
|
+
|
78
|
+
[ "$status" -eq 0 ]
|
79
|
+
[ "$output" = "" ]
|
80
|
+
}
|
81
|
+
@test "does not detect a anagram if the original word is repeated" {
|
82
|
+
run bash anagram.sh "go" "go Go GO"
|
83
|
+
|
84
|
+
[ "$status" -eq 0 ]
|
85
|
+
[ "$output" = "" ]
|
86
|
+
}
|
87
|
+
@test "anagrams must use all letters exactly once" {
|
88
|
+
run bash anagram.sh "tapper" "patter"
|
89
|
+
|
90
|
+
[ "$status" -eq 0 ]
|
91
|
+
[ "$output" = "" ]
|
92
|
+
}
|
93
|
+
@test "capital word is not own anagram" {
|
94
|
+
run bash anagram.sh "BANANA" "Banana"
|
95
|
+
|
96
|
+
[ "$status" -eq 0 ]
|
97
|
+
[ "$output" = "" ]
|
98
|
+
}
|
99
|
+
|