Skip to content

Commit

Permalink
Merge pull request JuliaLang#18 from exercism/smann/readme-code-forma…
Browse files Browse the repository at this point in the history
…tting

Add code formatting guidelines & typo fixes
  • Loading branch information
Katrina Owen authored Jan 28, 2017
2 parents 6937095 + 60eba25 commit 53931eb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Exercises for the Julia track go in the `exercises` directory and should follow

`exercises/<slug>/runtests.jl` Test suite for the exercise. Group related tests using [testsets](http://docs.julialang.org/en/release-0.5/stdlib/test/#working-with-test-sets).

`exercises/<slug>/example.jl` Example solution for the exercise. It should follow the [Julia Style Guide](http://docs.julialang.org/en/release-0.5/manual/style-guide/).
`exercises/<slug>/example.jl` Example solution for the exercise. It should follow the [Julia Style Guide](http://docs.julialang.org/en/release-0.5/manual/style-guide/) and the code formatting guidelines specified [below](#code-formatting-guidelines).

Replace `<slug>` with the exercise slug of the exercise you're working on.

See [Issue #2](https://github.com/exercism/xjulia/issues/2) for discussion on the structure.
See [Issue #2](https://github.com/exercism/xjulia/issues/2) for discussion on the structure and style guidelines.

### Adding it to config

Expand All @@ -41,7 +41,20 @@ Make sure to add the exercise to the `config.json` file, by adding an entry to t
}
]
```
If possible, add info on which topics the exercise is about and estimate a difficulty level from 1 to 10. We can adjust these later on when we know more about the exercise and how users solve them.
If possible, add info on which topics the exercise is about and estimate a difficulty level from 1 to 10. We can adjust these later on when we know more about the exercises and how users solve them.

### Testing the example solutions
Test your example solutions by running `julia runtests.jl` in the project directory. Specify exercise slugs as arguments to run only certain exercises: `julia runtests.jl <slug>`.

### Code Formatting Guidelines
Your example solutions should adhere to the following guidelines:
- 4 spaces per indentation level, no tabs
- use whitespace to make the code more readable
- no whitespace at the end of a line (trailing whitespace)
- comments are good, especially when they explain the algorithm
- try to adhere to a 92 character line length limit
- use upper camel case convention for type names
- use lower case with underscores for method names
- it is generally preferred to use ASCII operators and identifiers over Unicode equivalents whenever possible

These are based on the [General Formatting Guidelines](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#general-formatting-guidelines-for-julia-code-contributions) for contributions to the Julia codebase.

0 comments on commit 53931eb

Please sign in to comment.