elm/README.md

86 lines
4.3 KiB
Markdown
Raw Normal View History

2016-02-29 13:50:28 +00:00
# xElm
[![build status](https://travis-ci.org/exercism/xelm.svg?branch=master)](https://travis-ci.org/exercism/xelm)
2015-09-08 19:03:25 +00:00
Exercism Exercises in Elm
2015-09-08 19:03:25 +00:00
## Setup
2015-09-08 19:03:25 +00:00
2016-03-15 15:37:59 +00:00
The simplest way to install Elm is via Node.js/NPM.
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running, follow these steps to install the Elm platform and elm-test.
```bash
2017-05-28 01:47:09 +00:00
$ npm install
2016-03-15 15:37:59 +00:00
```
## Contributing
2015-09-08 19:03:25 +00:00
Thank you so much for contributing! :tada:
Please start by reading the general Exercism [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data).
We welcome pull requests that provide fixes and improvements to existing exercises. If you're unsure, then go ahead and open a GitHub issue, and we'll discuss the change.
Please keep the following in mind:
- Pull requests should be focused on a single exercise, issue, or change.
- We welcome changes to code style, and wording. Please open a separate PR for these changes if possible.
- Please open an issue before creating a PR that makes significant (breaking) changes to an existing exercise or makes changes across many exercises. It is best to discuss these changes before doing the work.
- Follow the coding standards found in [The Elm Style Guide](http://elm-lang.org/docs/style-guide). Please consider running [elm-format](https://github.com/avh4/elm-format) before submitting a pull request.
- Watch out for trailing spaces, extra blank lines, and spaces in blank lines.
- Each exercise must stand on its own. Do not reference files outside the exercise directory. They will not be included when the user fetches the exercise.
- Exercises should use only the Elm core libraries.
- Please do not add a README or README.md file to the exercise directory. The READMEs are constructed using shared metadata, which lives in the
[exercism/x-common](https://github.com/exercism/x-common) repository.
2017-05-28 01:47:09 +00:00
- Each exercise should have a test suite, an example solution, a template file for the real implementation and an `elm-package.json` file with the `elm-test` and `elm-console` dependencies. The CI build expects files to be named using the following convention. The example solution should be named `ExerciseModuleName.example`. The template file should be named `ExerciseModuleName.elm`. Test file should be named `Tests.elm`.
2017-05-28 01:47:09 +00:00
- The recommended workflow when working on an exercise is to first create the implementation and test files, `ExerciseModuleName.elm` and `tests/Tests.elm`. You'll likely want to copy one of the existing exercise directories as a quick start.
- Test the new exercise directly by running `npm test` from the exercise directory.
2016-03-15 15:37:59 +00:00
2017-05-28 01:47:09 +00:00
- Once the implementation of the exercise is complete, rename `ExerciseModuleName.elm` to `ExerciseModuleName.example.elm` and create the template `ExerciseModuleName.elm`.
2016-03-15 15:37:59 +00:00
- Make sure everything is good to go by running all tests with `bin/build.sh`.
- Please do not commit any Elm configuration files or directories inside the exercise, such as `elm-stuff`. Please include only the standard `elm-package.json`.
- Test files should use the following format:
2016-02-29 13:50:28 +00:00
```elm
2017-05-28 01:47:09 +00:00
module Tests exposing (..)
import Test exposing (..)
import Expect
2017-05-28 01:47:09 +00:00
import ExerciseModuleName
tests : Test
tests =
2016-08-21 15:42:13 +00:00
describe "Bob"
[ test "first test" <|
\() ->
True
|> Expect.equal True
, test "second test" <|
\() ->
False
|> Expect.equal False
]
```
- All the tests for xElm exercises can be run from the top level of the repo with `bin/build.sh`. Please run this command before submitting your PR.
2017-05-28 01:47:09 +00:00
- If you are submitting a new exercise, be sure to add it to the appropriate place in the `config.json` file. Also, please run `bin/fetch-configlet && bin/configlet` to ensure the exercise is configured correctly.
2015-09-08 19:03:25 +00:00
### Elm icon
We were unable to find copyright information about the Elm logo, nor information about who designed it. Presumably Evan Czaplicki, creator of the Elm language, also made the logo, and holds copyright. It may also fall within the public domain, since it is a geometric shape. We've adapted the official Elm logo by changing the colors, which we believe falls under "fair use".