Skip to content

Commit

Permalink
[style] Maximum line length
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jan 16, 2019
1 parent 350e948 commit a903b07
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docs/src/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,29 @@ function foo(x)
end
```

#### Line length

#### TODO: Line breaks
Following the Google style guide for [line length](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#32-line-length)
in python, keep lines under an 80 character limit.

We make exceptions for
- URLs
- pathnames
- long string constants not containing whitespace that would be inconvenient to
split across multiple lines.

For readability, don't split a one-line function over multiple lines.

Good:
```julia
f(x) = 1 + x + x^2 + x^3 + x^3
```

Bad:
```julia
f(x) = 1 + x +
x^2 + x^3
```

### Syntax

Expand Down

0 comments on commit a903b07

Please sign in to comment.