You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-19
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Attempt to follow both the [Julia Contribution Guidelines](https://github.com/Ju
26
26
When convention guidelines conflict this guide takes precedence (known conflicts will be noted in this guide).
27
27
28
28
- 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.
30
30
- 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/).
31
31
- 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).
32
32
- 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
36
36
- Avoid padding brackets with spaces. ex. `Int64(value)` preferred over `Int64( value )`.
37
37
38
38
## 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)
40
44
-[Module Imports](#module-imports)
41
45
-[Function Exports](#function-exports)
42
46
-[Global Variables](#global-variables)
@@ -53,16 +57,16 @@ When convention guidelines conflict this guide takes precedence (known conflicts
53
57
-[Package version specifications](#package-version-specifications)
54
58
-[Comments](#comments)
55
59
-[Documentation](#documentation)
56
-
-[Test Formatting](#test-formatting)
60
+
-[Test Formatting](#test-formatting)
57
61
-[Testsets](#testsets)
58
62
-[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)
61
65
-[Sublime Text Settings](#sublime-text-settings)
62
66
-[Vim Settings](#vim-settings)
63
67
-[Atom Settings](#atom-settings)
64
68
-[VS-Code Settings](#vs-code-settings)
65
-
-[Code Style Badge](#code-style-badge)
69
+
-[Code Style Badge](#code-style-badge)
66
70
67
71
## Code Formatting
68
72
@@ -282,7 +286,7 @@ function maybe_do_thing()
282
286
end
283
287
```
284
288
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:
286
290
287
291
```julia
288
292
# Yes:
@@ -328,7 +332,7 @@ function foobar(
328
332
end
329
333
```
330
334
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.
332
336
Similarly, you can follow the same rule if you break up positional and keyword arguments
333
337
across two lines.
334
338
@@ -357,7 +361,7 @@ function foobar(
357
361
# code
358
362
end
359
363
360
-
# No: Because the separate line is more than 92 characters.
364
+
# No: Because the separate line is more than 110 characters.
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)
404
408
```julia
405
409
# Yes:
406
410
spam(ham[1], [eggs])
407
-
411
+
408
412
# No:
409
413
spam( ham[ 1 ], [ eggs ] )
410
414
```
@@ -414,7 +418,7 @@ xy = foo(x, y=3)
414
418
```julia
415
419
# Yes:
416
420
if x == 4 @show(x, y); x, y = y, x end
417
-
421
+
418
422
# No:
419
423
if x == 4 @show(x , y) ; x , y = y , x end
420
424
```
@@ -983,7 +987,7 @@ Try to document a function and not individual methods where possible as typicall
983
987
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.
984
988
985
989
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.
987
991
988
992
```julia
989
993
"""
@@ -1099,7 +1103,7 @@ function Manager end
1099
1103
1100
1104
```
1101
1105
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.
1103
1107
Avoid aligning the text to the `:`.
1104
1108
1105
1109
```julia
@@ -1174,7 +1178,7 @@ Then navigate to: `Preferences > Settings - More > Syntax Specific - User`
1174
1178
"tab_size": 4,
1175
1179
"trim_trailing_white_space_on_save": true,
1176
1180
"ensure_newline_at_eof_on_save": true,
1177
-
"rulers": [92]
1181
+
"rulers": [110]
1178
1182
}
1179
1183
```
1180
1184
@@ -1197,7 +1201,7 @@ Then create or edit `.vim/after/ftplugin/julia.vim`, adding the Julia-specifc co
1197
1201
```
1198
1202
" ~/.vim/after/ftplugin/julia.vim
1199
1203
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.
1201
1205
setlocal colorcolumn=+1 " Highlight first column beyond the line limit.
1202
1206
```
1203
1207
@@ -1207,12 +1211,12 @@ which adds Julia-aware syntax highlighting and a few cool other features.
1207
1211
1208
1212
### Atom Settings
1209
1213
1210
-
Atom defaults preferred line length to 80 characters. We want that at 92for julia.
1214
+
Atom defaults preferred line length to 80 characters. We want that at 110for julia.
1211
1215
To change it:
1212
1216
1213
1217
1. Go to `Atom -> Preferences -> Packages`.
1214
1218
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.
1216
1220
1217
1221
1218
1222
### VS-Code Settings
@@ -1229,7 +1233,7 @@ To modify these settings open your VS Code Settings with <kbd>CMD</kbd>+<kbd>,</
0 commit comments