Skip to content

Commit b758cb5

Browse files
LineLengths=110
1 parent dd1941e commit b758cb5

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

README.md

+23-19
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Attempt to follow both the [Julia Contribution Guidelines](https://github.com/Ju
2626
When convention guidelines conflict this guide takes precedence (known conflicts will be noted in this guide).
2727

2828
- Use 4 spaces per indentation level, no tabs.
29-
- Try to adhere to a 92 character line length limit.
29+
- Try to adhere to a 110 character line length limit.
3030
- Use upper camel-case convention for [modules](https://docs.julialang.org/en/v1/manual/modules/) and [types](https://docs.julialang.org/en/v1/manual/types/).
3131
- Use lower case with underscores for method names (note: contrary to this, it is a common stylistic choice in the [Julia base code](https://github.com/JuliaLang/julia/tree/master/base) to use lower case without underscores).
3232
- Import modules with `using`, with one module per line and at the top of the file when possible.
@@ -36,7 +36,11 @@ When convention guidelines conflict this guide takes precedence (known conflicts
3636
- Avoid padding brackets with spaces. ex. `Int64(value)` preferred over `Int64( value )`.
3737

3838
## Contents
39-
- [Code Formatting](#code-formatting)
39+
- [Blue: a Style Guide for Julia](#blue-a-style-guide-for-julia)
40+
- [A Word on Consistency](#a-word-on-consistency)
41+
- [Synopsis](#synopsis)
42+
- [Contents](#contents)
43+
- [Code Formatting](#code-formatting)
4044
- [Module Imports](#module-imports)
4145
- [Function Exports](#function-exports)
4246
- [Global Variables](#global-variables)
@@ -53,16 +57,16 @@ When convention guidelines conflict this guide takes precedence (known conflicts
5357
- [Package version specifications](#package-version-specifications)
5458
- [Comments](#comments)
5559
- [Documentation](#documentation)
56-
- [Test Formatting](#test-formatting)
60+
- [Test Formatting](#test-formatting)
5761
- [Testsets](#testsets)
5862
- [Comparisons](#comparisons)
59-
- [Performance and Optimization](#performance-and-optimization)
60-
- [Editor Configuration](#editor-configuration)
63+
- [Performance and Optimization](#performance-and-optimization)
64+
- [Editor Configuration](#editor-configuration)
6165
- [Sublime Text Settings](#sublime-text-settings)
6266
- [Vim Settings](#vim-settings)
6367
- [Atom Settings](#atom-settings)
6468
- [VS-Code Settings](#vs-code-settings)
65-
- [Code Style Badge](#code-style-badge)
69+
- [Code Style Badge](#code-style-badge)
6670

6771
## Code Formatting
6872

@@ -282,7 +286,7 @@ function maybe_do_thing()
282286
end
283287
```
284288

285-
Functions definitions with parameter lines which exceed 92 characters should separate each parameter by a newline and indent by one-level:
289+
Functions definitions with parameter lines which exceed 110 characters should separate each parameter by a newline and indent by one-level:
286290

287291
```julia
288292
# Yes:
@@ -328,7 +332,7 @@ function foobar(
328332
end
329333
```
330334

331-
If all of the arguments fit inside the 92 character limit then you can place them on 1 line.
335+
If all of the arguments fit inside the 110 character limit then you can place them on 1 line.
332336
Similarly, you can follow the same rule if you break up positional and keyword arguments
333337
across two lines.
334338

@@ -357,7 +361,7 @@ function foobar(
357361
# code
358362
end
359363

360-
# No: Because the separate line is more than 92 characters.
364+
# No: Because the separate line is more than 110 characters.
361365
function foobar(
362366
df::DataFrame, id::Symbol, variable::Symbol, value::AbstractString; prefix::AbstractString=""
363367
)
@@ -372,7 +376,7 @@ function foobar(
372376
# code
373377
end
374378

375-
# No: The kwargs are more than 92 characters.
379+
# No: The kwargs are more than 110 characters.
376380
function foobar(
377381
df::DataFrame, id::Symbol, variable::Symbol, value::AbstractString;
378382
prefix="I'm a long default setting that probably shouldn't exist", msg="I'm another long default settings that probably shouldn't exist",
@@ -404,7 +408,7 @@ xy = foo(x, y=3)
404408
```julia
405409
# Yes:
406410
spam(ham[1], [eggs])
407-
411+
408412
# No:
409413
spam( ham[ 1 ], [ eggs ] )
410414
```
@@ -414,7 +418,7 @@ xy = foo(x, y=3)
414418
```julia
415419
# Yes:
416420
if x == 4 @show(x, y); x, y = y, x end
417-
421+
418422
# No:
419423
if x == 4 @show(x , y) ; x , y = y , x end
420424
```
@@ -983,7 +987,7 @@ Try to document a function and not individual methods where possible as typicall
983987
If you are adding a method to a function which already has a docstring only add a docstring if the behaviour of your function deviates from the existing docstring.
984988

985989
Docstrings are written in [Markdown](https://en.wikipedia.org/wiki/Markdown) and should be concise.
986-
Docstring lines should be wrapped at 92 characters.
990+
Docstring lines should be wrapped at 110 characters.
987991

988992
```julia
989993
"""
@@ -1099,7 +1103,7 @@ function Manager end
10991103
11001104
```
11011105

1102-
If the documentation for bullet-point exceeds 92 characters the line should be wrapped and slightly indented.
1106+
If the documentation for bullet-point exceeds 110 characters the line should be wrapped and slightly indented.
11031107
Avoid aligning the text to the `:`.
11041108

11051109
```julia
@@ -1174,7 +1178,7 @@ Then navigate to: `Preferences > Settings - More > Syntax Specific - User`
11741178
"tab_size": 4,
11751179
"trim_trailing_white_space_on_save": true,
11761180
"ensure_newline_at_eof_on_save": true,
1177-
"rulers": [92]
1181+
"rulers": [110]
11781182
}
11791183
```
11801184

@@ -1197,7 +1201,7 @@ Then create or edit `.vim/after/ftplugin/julia.vim`, adding the Julia-specifc co
11971201
```
11981202
" ~/.vim/after/ftplugin/julia.vim
11991203
setlocal expandtab " Replace tabs with spaces.
1200-
setlocal textwidth=92 " Limit lines according to Julia's CONTRIBUTING guidelines.
1204+
setlocal textwidth=110 " Limit lines according to Julia's CONTRIBUTING guidelines.
12011205
setlocal colorcolumn=+1 " Highlight first column beyond the line limit.
12021206
```
12031207

@@ -1207,12 +1211,12 @@ which adds Julia-aware syntax highlighting and a few cool other features.
12071211

12081212
### Atom Settings
12091213

1210-
Atom defaults preferred line length to 80 characters. We want that at 92 for julia.
1214+
Atom defaults preferred line length to 80 characters. We want that at 110 for julia.
12111215
To change it:
12121216

12131217
1. Go to `Atom -> Preferences -> Packages`.
12141218
2. Search for the "language-julia" package and open the settings for it.
1215-
3. Find preferred line length (under "Julia Grammar") and change it to 92.
1219+
3. Find preferred line length (under "Julia Grammar") and change it to 110.
12161220

12171221

12181222
### VS-Code Settings
@@ -1229,7 +1233,7 @@ To modify these settings open your VS Code Settings with <kbd>CMD</kbd>+<kbd>,</
12291233
"files.insertFinalNewline": true,
12301234
"files.trimFinalNewlines": true,
12311235
"files.trimTrailingWhitespace": true,
1232-
"editor.rulers": [92],
1236+
"editor.rulers": [110],
12331237
},
12341238
}
12351239
```

0 commit comments

Comments
 (0)