Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jan 16, 2019
1 parent 03b2f45 commit c2cf5b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/src/style.md
Expand Up @@ -147,16 +147,17 @@ end
#### Line breaks

Following the Google style guide for [indentation](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#34-indentation)
in python, break lines that exceed the [Line length](@ref) as appropriate.
in python, break lines that exceed the line length as appropriate.

Good:
```julia
# Arguments to the function are listed on a new line and indented.
function my_very_long_function_name(
with_lots_of_long_arguments_1, and_another_long_one)
# First line of the function begins here.
end

# Align arguments vertically.
# Arguments to the function are aligned vertically.
function my_very_long_function_name(with_lots_of_long_arguments_1,
and_another_long_one)
# First line of the function begins here.
Expand All @@ -165,12 +166,13 @@ end

Bad:
```julia
# Line exceeds line length.
# The line exceeds the maximum line length (80 characters).
function my_very_long_function_name(with_lots_of_long_arguments_1, and_another_long_one)
# First line of the function begins here.
end

# When wrapping with a hanging indent, don't leave things on the first line.
# If vertical alignment is not used, then the arguments should not begin
# on the first line.
function my_very_long_function_name(with_lots_of_long_arguments_1,
and_another_long_one)
# First line of the function begins here.
Expand Down

0 comments on commit c2cf5b3

Please sign in to comment.