Skip to content

Commit 644eded

Browse files
committed
Prettier!
1 parent 8c5d7ac commit 644eded

17 files changed

+602
-37
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.prettierrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"endOfLine": "auto",
5+
"htmlWhitespaceSensitivity": "css",
6+
"insertPragma": false,
7+
"jsxBracketSameLine": false,
8+
"jsxSingleQuote": false,
9+
"printWidth": 80,
10+
"proseWrap": "preserve",
11+
"quoteProps": "as-needed",
12+
"semi": false,
13+
"singleQuote": true,
14+
"tabWidth": 2,
15+
"trailingComma": "es5",
16+
"useTabs": false,
17+
"vueIndentScriptAndStyle": false,
18+
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ These are the official docs for Exercism. We welcome all and any contributions.
77
## How this repo is organised
88

99
There are three top-level repositories:
10+
1011
- **anatomy:** How Exercism fits together with technical specs for maintainers.
1112
- **product:** The product philosophy and decisions behind Exercism.
1213
- **user-facing:** User facing docs for FAQs, help, etc

TODO.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# TODO
1+
# TODO
22

33
These are things that should be done before this repo becomes public:

anatomy/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
The documents in this section explore the different areas of Exercism, how they are built, and the technical specifications for each area.
44

55
These documents are written for maintainers and contributors to Exercism, rather than end-users, and so may presume more innate knowledge of Exercism.
6-

anatomy/test-runners/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
A Test Runner is a piece of software that runs a an exercise's tests against a student's code.
44

55
Test runners give us two advantages
6-
1. They enable in-browser coding, where a student can iterate on a solution seeing whether the tests pass or fail.
6+
7+
1. They enable in-browser coding, where a student can iterate on a solution seeing whether the tests pass or fail.
78
2. They allow us to provide information to mentors on whether a student's code "works" or not.
89

9-
Each language has it's own test runner, written in that language.
10+
Each language has it's own test runner, written in that language.
1011
The website acts as the orchestrator between the test runners and student's submissions.
1112

1213
Each test runner lives in the Exercism GitHub organsation in a repository named `$LANG-test-runner` (e.g. `ruby-test-runner`).
@@ -16,9 +17,7 @@ If you would like to get involved in helping with an existing Test Runner, pleas
1617
If you would like to create a Test Runner for a language that currently does not have one, please follow the [creating a Test Runner](creating-from-scratch.md) instructions.
1718

1819
This directory contains the following information:
20+
1921
- **`creating-from-scratch.md:`** Information on creating a Test Runner from scratch.
2022
- **`interface.md:`** The Test Runner interface.
2123
- **`docker.md:`** How to build a Docker image with Docker for local testing and deployment.
22-
23-
24-

anatomy/test-runners/docker.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ The Dockerfile should create the minimal image needed for the Test Runner to run
1010

1111
It should produce an image with as a small a size as possible.
1212
The minimal-sized image is often based on Alpine Linux.
13-
Applying the official [Dockerfile best practices](https://docs.docker.com/develop/develop-images/Dockerfile_best-practices/) can help to create a minimal image.
13+
Applying the official [Dockerfile best practices](https://docs.docker.com/develop/develop-images/Dockerfile_best-practices/) can help to create a minimal image.
1414

1515
## Executing the Docker container
1616

1717
When we run the Docker container we execute a `run.sh` script.
1818
To ensure this works properly the following rules must be following:
1919

2020
- The working directory should be `/opt/test-runner`.
21-
- There should be a `/opt/test-runner/bin/run.sh` script that can be called with 3 parameters:
21+
- There should be a `/opt/test-runner/bin/run.sh` script that can be called with 3 parameters:
2222
the `exercise slug`, the path to the `solution folder`, and the path to the `output folder`.
2323
For more information see [The Interface](./interface.md).
2424

2525
## Local development
2626

27-
To allow for local development we have produced an exectuable called [tooling-webserver](https://github.com/exercism/tooling-webserver/blob/master/README.md#installation-docker).
27+
To allow for local development we have produced an exectuable called [tooling-webserver](https://github.com/exercism/tooling-webserver/blob/master/README.md#installation-docker).
2828
Please follow its installation instructions.
2929

3030
## Creating/editing a Dockerfile

anatomy/test-runners/interface.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The `results.json` file should be structured as followed:
2727
"status": "fail",
2828
"message": "Expected 42 but got 123123",
2929
"output": "Debugging information output by the user",
30-
"cmd": "assert_equal 42, answerToTheUltimateQuestion()",
30+
"cmd": "assert_equal 42, answerToTheUltimateQuestion()"
3131
}
3232
]
3333
}
@@ -40,6 +40,7 @@ The `results.json` file should be structured as followed:
4040
> key: `status`
4141
4242
The following overall statuses are valid:
43+
4344
- `pass`: All tests passed
4445
- `fail`: At least one test failed
4546
- `error`: To be used when the tests did not run correctly (e.g. a compile error, a syntax error)
@@ -65,18 +66,20 @@ This is the name of the test in a human-readable format.
6566
> key: `cmd`
6667
6768
This is the body of the command that is being tests. It should have any `skip` annotations removed. For example, the following Ruby test:
69+
6870
```ruby
69-
def test_duplicate_items_uniqs_list
70-
skip
71-
cart = ShoppingCart.new
72-
cart.add(:STARIC)
73-
cart.add(:MEDNEW)
74-
cart.add(:MEDNEW)
75-
assert_equal 'Newspaper, Rice', cart.items_list
76-
end
71+
def test_duplicate_items_uniqs_list
72+
skip
73+
cart = ShoppingCart.new
74+
cart.add(:STARIC)
75+
cart.add(:MEDNEW)
76+
cart.add(:MEDNEW)
77+
assert_equal 'Newspaper, Rice', cart.items_list
78+
end
7779
```
7880

7981
... should return a cmd value of:
82+
8083
```ruby
8184
"cart = ShoppingCart.new
8285
cart.add(:STARIC)
@@ -92,6 +95,7 @@ assert_equal 'Newspaper, Rice', cart.items_list"
9295
> key: `status`
9396
9497
The following per-test statuses are valid:
98+
9599
- `pass`: The test passed
96100
- `fail`: The test failed
97101
- `error`: The test errored
@@ -138,7 +142,8 @@ Test Code:
138142

139143
### How to add metadata for your language's test suite
140144

141-
All roads lead to Rome and there is no prescribed pattern to arrive at this. There are several approaches taken so far:
145+
All roads lead to Rome and there is no prescribed pattern to arrive at this.
146+
There are several approaches taken so far:
142147

143148
- Auxillary JSON files compiled manually, merged with test results during the test run-time.
144149
- Automated static analysis of the test suite, merged with test results during the test run-time.

package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"devDependencies": {
3+
"husky": "^4.2.5",
4+
"pretty-quick": "^2.0.1",
5+
"prettier": "^2.0.5"
6+
},
7+
"husky": {
8+
"hooks": {
9+
"pre-commit": "pretty-quick --staged"
10+
}
11+
}
12+
}

product/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# Product Docs
22

3-
These documents outline the product decisions and thinking behind Exercism.
3+
These documents outline the product decisions and thinking behind Exercism.
44
They aim to present a picture of why things on Exercism work the way they do.
55

66
## Exercism Concepts
7+
78
- [Reputation](./reputation.md)
89
- [Credits](./credits.md)
910

1011
## Language Tracks
12+
1113
- [General info](./tracks.md)
1214

1315
### Exercises
16+
1417
- [Practice Exercises](./practice-exercises.md)
1518
- [Concept Exercises](./concept-exercises.md)
1619

product/concept-exercises.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ Concept Exercises have the following characteristics:
99
- Stubs/boilerplate are used to avoid the student having to learn/write unnecessary code on exercises.
1010

1111
## Concepts
12-
Exercises are unlocked based on concepts taught and learnt.
13-
Each Concept Exercise must teach one or more concepts.
12+
13+
Exercises are unlocked based on concepts taught and learnt.
14+
Each Concept Exercise must teach one or more concepts.
1415
It may also have prerequisites on Concepts, which means it will not be unlocked until Concept Exercises teaching those prerequisite concepts have been completed.
1516

1617
## Difficulty
17-
Concept Exercises should not become inherently more difficult as the track progresses.
18-
A seasoned developer in Language X should be able to work through all the Concept Exercises on that track spending no more than 5-10 minutes solving each one.
19-
As each exercise should be focussed on getting someone to use a concept for the first time, and because the seasoned developer already understands that concept in Language X, the exercise should feel relatively trivial for them.
18+
19+
Concept Exercises should not become inherently more difficult as the track progresses.
20+
A seasoned developer in Language X should be able to work through all the Concept Exercises on that track spending no more than 5-10 minutes solving each one.
21+
As each exercise should be focussed on getting someone to use a concept for the first time, and because the seasoned developer already understands that concept in Language X, the exercise should feel relatively trivial for them.
2022
Later exercises may feel more difficult to a developer unfamiliar with Language X, but only because the later exercise is teaching a concept which in itself is more complicated (for example, most people would agree Recursion is a more complex topic to learn for the first time, than a Loop is to remap from one language to another).
2123

2224
## Feedback
23-
Concept Exercises are not mentored.
24-
When a student submits a submission that gets the tests passing for a Concept Exercise, we check for an Analyzer or Representer to give feedback.
25-
If none is found, then the solution is approved.
25+
26+
Concept Exercises are not mentored.
27+
When a student submits a submission that gets the tests passing for a Concept Exercise, we check for an Analyzer or Representer to give feedback.
28+
If none is found, then the solution is approved.
2629
This shifts the burden of teaching to the exercise, which must provide a clear pathway to learning the concept that is being taught.

product/credits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A user receives a credit "present" each year upon their Exercism birthday.
1717
### Mentoring
1818

1919
Every time someone requests mentoring, they add a bounty to their request. The mentor who successfully mentors that solution receives that bounty.
20-
20+
2121
In general, a user's [mentoring reputation](../reputation.md) determines the max bounty they can recieve. The more someone mentors (successfully), the better bounties they have access to and the more credits they can acquire.
2222

2323
## Spending Credits

product/experience.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ There are various ways of acquiring experience.
1515
Experience is acquired by successfully completing Concept and Practice Exercises.
1616

1717
All exercises award points, but different exercises may award different amounts of points, depending on:
18+
1819
- Whether the exercise is Concept or Practice
1920
- The difficulty of the exercise
2021
- Whether the same exercise has been completed in an alternative language (ie, you get more points the first time you complete `Bob` than the 5th time)
@@ -25,6 +26,7 @@ An algorithm considering these factors is yet to be decided.
2526
### 2. Track milestones
2627

2728
At certain points during the track, extra experience will be awarded:
29+
2830
- Completing a Concept exercise in a track
2931
- Completing 10 Concept exercises in a track
3032
- Completing a Practice exercise in a track
@@ -41,6 +43,7 @@ Much like any modern roleplaying game, experience points are accrued and represe
4143
### Level Tags
4244

4345
Levels are also grouped into labels. For example:
46+
4447
- 1 - 9 : Newbie
4548
- 10 - 19 : Explorer
4649
- 20 - 39 : Adventurer

product/representers.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ An example helps to explain representers best. Let's presume two students submit
66

77
```ruby
88
# Student 1's submission
9-
def self.hello(name="World")
9+
def self.hello(name = 'World')
1010
"Hello, #{name}!"
1111
end
1212
```
1313

1414
```ruby
1515
# Student 2's submission
16-
def self.hello(nom="World")
17-
%Q{Hello, #{nom}!}
16+
def self.hello(nom = 'World')
17+
"Hello, #{nom}!"
1818
end
1919
```
2020

21-
Although the code to these solutions is different (different indentation, variable names, and string syntax), they are essentially the same. So by creating a normalised representation of them, we can *treat* them as the same for the purposes of providing feedback. This dramatically reduces the amount of duplicate mentoring that needs to happen.
21+
Although the code to these solutions is different (different indentation, variable names, and string syntax), they are essentially the same. So by creating a normalised representation of them, we can _treat_ them as the same for the purposes of providing feedback. This dramatically reduces the amount of duplicate mentoring that needs to happen.
2222

2323
Each track maintains it's own representer, specific to that language. There is no standarised output - we only require a track to be internally consistent.

product/reputation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Reputation
22

3-
Reputation is the system that allows people to acquire "trust" within the Exericsm ecosystem.
3+
Reputation is the system that allows people to acquire "trust" within the Exericsm ecosystem.
44

55
Reputation is a measure of how much an individual has contributed to Exercism, both through contribution to the platform (e.g. through creation of software, exercises and docs) and contribution to the community (e.g. mentoring).
66

product/tracks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Tracks are Exercism's language "courses".
44

55
Each track is maintained by a seperate (although sometimes overlapping) group of volunteers.
66

7-
Tracks are made up of [Concept Exercises](./concept-exercises.md) and [Practice Exercise](./practice-exercises.md).
7+
Tracks are made up of [Concept Exercises](./concept-exercises.md) and [Practice Exercise](./practice-exercises.md).
88

9-
They have language-specific tooling, such as [Test Runners](./test-runners.md), [Representers](./representers.md), and [Analyzers](./analyzers.md).
9+
They have language-specific tooling, such as [Test Runners](./test-runners.md), [Representers](./representers.md), and [Analyzers](./analyzers.md).

0 commit comments

Comments
 (0)