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: crates/roughly/tests/format/formatter.template.md
+3-6Lines changed: 3 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,7 @@ The formatter follows these key principles:
28
28
29
29
### Why Non-Invasive?
30
30
31
-
R is an expression-based language with a strong focus on numerical computing and data analysis. Unlike many other programming languages, R code is often written interactively and exploratively, where preserving the original intent and structure of expressions is crucial for readability and debugging.
32
-
33
-
The non-invasive approach means roughly respects your existing line breaks and won't arbitrarily split expressions that you've chosen to keep on one line. **Non-invasive formatting tries to minimize the amount of line-breaks not set by the programmer** by following these key principles:
31
+
The non-invasive approach means Roughly respects your existing line breaks and won't arbitrarily split expressions that you've chosen to keep on one line. **Non-invasive formatting tries to minimize the amount of line-breaks not set by the programmer** by following these key principles:
34
32
35
33
-**Single line expressions are never broken into multiple lines** (with the exception of loops like `for`, `while`, `repeat`, because they don't yield useful values and can only perform side effects, so they are not normal expressions in that sense)
36
34
-**Both hugging and not hugging is allowed** for function calls and other constructs
@@ -39,9 +37,8 @@ The non-invasive approach means roughly respects your existing line breaks and w
39
37
This is particularly important in R because:
40
38
41
39
-**Data analysis workflows**: Short, expressive one-liners are common and meaningful
42
-
-**Interactive development**: Code is often built incrementally, and forced line breaks can disrupt the flow
43
40
-**Mathematical expressions**: Complex formulas are often more readable when kept compact
44
-
-**Functional style**: R's functional nature benefits from preserving the structure of nested calls
41
+
-**Functional style**: R's functional nature benefits from preserving the structure of nested expresions
45
42
46
43
#### Why This Matters for Numerical Computing
47
44
@@ -285,7 +282,7 @@ if(
285
282
286
283
```r
287
284
# for_loops : compare
288
-
for(itemindata) process(item)
285
+
for(iteminsequence) process(item)
289
286
```
290
287
291
288
**While loops** follow similar block enforcement rules:
Copy file name to clipboardExpand all lines: docs/content/formatter.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,7 @@ The formatter follows these key principles:
28
28
29
29
### Why Non-Invasive?
30
30
31
-
R is an expression-based language with a strong focus on numerical computing and data analysis. Unlike many other programming languages, R code is often written interactively and exploratively, where preserving the original intent and structure of expressions is crucial for readability and debugging.
32
-
33
-
The non-invasive approach means roughly respects your existing line breaks and won't arbitrarily split expressions that you've chosen to keep on one line. **Non-invasive formatting tries to minimize the amount of line-breaks not set by the programmer** by following these key principles:
31
+
The non-invasive approach means Roughly respects your existing line breaks and won't arbitrarily split expressions that you've chosen to keep on one line. **Non-invasive formatting tries to minimize the amount of line-breaks not set by the programmer** by following these key principles:
34
32
35
33
-**Single line expressions are never broken into multiple lines** (with the exception of loops like `for`, `while`, `repeat`, because they don't yield useful values and can only perform side effects, so they are not normal expressions in that sense)
36
34
-**Both hugging and not hugging is allowed** for function calls and other constructs
@@ -39,9 +37,8 @@ The non-invasive approach means roughly respects your existing line breaks and w
39
37
This is particularly important in R because:
40
38
41
39
-**Data analysis workflows**: Short, expressive one-liners are common and meaningful
42
-
-**Interactive development**: Code is often built incrementally, and forced line breaks can disrupt the flow
43
40
-**Mathematical expressions**: Complex formulas are often more readable when kept compact
44
-
-**Functional style**: R's functional nature benefits from preserving the structure of nested calls
41
+
-**Functional style**: R's functional nature benefits from preserving the structure of nested expresions
0 commit comments