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
+2-3
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,9 @@ Please keep the following in mind:
29
29
exercise.
30
30
31
31
- Each problem should have a test suite, an example solution, and a template
32
-
file for the real implementation. The example solution should be named
33
-
`example.exs`.
32
+
file for the real implementation. Read about [the anatomy of practice exercises][https://github.com/exercism/docs/blob/main/anatomy/tracks/practice-exercises.md] or [the anatomy of concept exercises][https://github.com/exercism/docs/blob/main/anatomy/tracks/concept-exercises.md], depending on to which type of exercise you want to contribute.
34
33
35
-
-Use typespecs in the example and template files as described [here](http://elixir-lang.org/getting-started/typespecs-and-behaviours.html).
34
+
-For practice exercises, use typespecs in the example and template files as described [here](http://elixir-lang.org/getting-started/typespecs-and-behaviours.html).
36
35
37
36
- Each test file should have a `test_helper.exs` with code like the following
38
37
at the top of the file. This allows the tests to be run on CI and configures
Copy file name to clipboardExpand all lines: README.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ installation instructions can be found at
14
14
15
15
---
16
16
17
-
> It is recommended to test BEFORE submitting a PR. It will test your submission, ensure
17
+
> It is recommended to test BEFORE submitting a PR. It will test your submission, ensure
18
18
> that the repository builds as a whole, and help guard against unintentional, unrelated changes.
19
19
20
20
---
@@ -44,11 +44,13 @@ cd exercises/$EXERCISE_NAME
44
44
mix test
45
45
```
46
46
47
-
### Testing the Build
47
+
### Dialyzer
48
48
49
-
TravisCI is used to test the build against different environments.
49
+
To run dialyzer on all exercises, run `./bin/dialyzer_check.sh`. It might take a really long time the first time you run it. It will also be run for you by Github Actions as part of the PR check.
50
50
51
-
TravisCI's current testing routine can be found in [.travis.yml](https://github.com/exercism/elixir/blob/master/.travis.yml)
51
+
### Code and document formatting
52
+
53
+
To check formatting of all exercises and all documents, run `./bin/check_formatting.sh`. It will also be run for you by Github Actions as part of the PR check.
Copy file name to clipboardExpand all lines: reference/implementing-a-concept-exercise.md
+35-39
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,12 @@ This document describes how to implement a Concept Exercise for the Elixir track
6
6
7
7
-[The features of v3][docs-features-of-v3].
8
8
-[Rationale for v3][docs-rationale-for-v3].
9
-
-[What are concept exercise and how they are structured?][docs-concept-exercises]
9
+
-[What are concepts and how they are structured?][anatomy-of-a-concept]
10
+
-[What are concept exercise and how they are structured?][anatomy-of-a-concept-exercise]
10
11
11
12
Please also watch the following video:
12
13
13
-
-[The Anatomy of a Concept Exercise][anatomy-of-a-concept-exercise].
14
+
-[The Anatomy of a Concept Exercise][anatomy-of-a-concept-exercise-video].
14
15
15
16
As this document is generic, the following placeholders are used:
16
17
@@ -23,35 +24,35 @@ As this document is generic, the following placeholders are used:
23
24
-`$first-and-last-name`: your first and last name (e.g. `Tim Austin`)
24
25
-`$git-email`: the email address you use for git (e.g. `[email protected]`)
25
26
26
-
Before implementing the exercise, please make sure you have a good understanding of what the exercise should be teaching (and what not). This information can be found in the exercise's GitHub issue. Having done this, please read the [Elixir Concept exercises introduction][concept-exercises]. If you have come up with something completely new, create a new issue _first_ so we can discuss the Concept Exercise.
27
+
Before implementing the exercise, please make sure you have a good understanding of what the exercise should be teaching (and what not). This information can be found in the exercise's GitHub issue. If you have come up with something completely new, create a new issue _first_ so we can discuss the Concept Exercise.
27
28
28
29
To implement a Concept Exercise, the following files must be added:
29
30
30
31
```text
31
-
languages
32
-
└── elixir
33
-
├── concepts
34
-
|└── $concept-1
35
-
| ├── about.md
36
-
| └── links.json
37
-
└── exercises
38
-
└── concept
39
-
└── $slug
40
-
├── .docs
41
-
│ ├── instructions.md
42
-
│ ├── introduction.md
43
-
│ └── hints.md
44
-
├── .meta
45
-
│ ├── config.json
46
-
│ ├── design.md
47
-
│ └── exemplar.ex
48
-
├── lib
49
-
│ └── $elixir_slug.ex
50
-
├── mix.exs
51
-
├── mix.lock
52
-
└── test
53
-
├── $elixir_slug_test.exs
54
-
└── test_helper.exs
32
+
elixir
33
+
├── concepts
34
+
|└── $concept-1
35
+
|├── about.md
36
+
| ├── introduction.md
37
+
| └── links.json
38
+
└── exercises
39
+
└── concept
40
+
└── $slug
41
+
├── .docs
42
+
│ ├── instructions.md
43
+
│ ├── introduction.md
44
+
│ └── hints.md
45
+
├── .meta
46
+
│ ├── config.json
47
+
│ ├── design.md
48
+
│ └── exemplar.ex
49
+
├── lib
50
+
│ └── $elixir_slug.ex
51
+
├── mix.exs
52
+
├── mix.lock
53
+
└── test
54
+
├── $elixir_slug_test.exs
55
+
└── test_helper.exs
55
56
```
56
57
57
58
## Step 1: Add code files
@@ -61,24 +62,20 @@ The configuration files may be copied from another exercise. But it would be rec
61
62
Now create the following three files:
62
63
63
64
-`lib/$elixir_slug.ex`. the stub implementation file, which is the starting point for students to work on the exercise.
64
-
-`test/$elixir_slug_test.ex`: the test suite.
65
+
-`test/$elixir_slug_test.exs`: the test suite.
65
66
-`.meta/exemplar.ex`: an exemplar implementation that passes all the tests.
66
67
67
68
## Step 2: Add documentation files
68
69
69
70
How to create the files common to all tracks is described in the [how to implement a concept exercise document][how-to-implement-a-concept-exercise].
70
71
71
-
## Step 3: Update list of implemented exercises
72
-
73
-
- Add the exercise to the [list of implemented exercises][implemented-exercises].
74
-
75
-
## Step 4: Add analyzer (optional)
72
+
## Step 3: Add analyzer (optional)
76
73
77
74
Some exercises could benefit from having an exercise-specific [analyzer][analyzer]. If so, specify what analysis rules should be applied to this exercise and why.
78
75
79
76
_Skip this step if you're not sure what to do._
80
77
81
-
## Step 5: Add representation (optional)
78
+
## Step 4: Add representation (optional)
82
79
83
80
Some exercises could benefit from having an custom representation as generated by the [Elixir representer][representer]. If so, specify what changes to the representation should be applied and why.
84
81
@@ -94,12 +91,11 @@ If you have any questions regarding implementing the exercise, please post them
0 commit comments