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: RULES.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -583,11 +583,15 @@ The goal of the rule is to keep error contracts clear and stable. If it can fail
583
583
584
584
## `no_literal_args`
585
585
586
-
Disallow passing primitive literal numbers and booleans directly as function arguments.
586
+
Disallow passing primitive literal numbers and booleans directly as
587
+
function arguments.
587
588
588
-
Passing literal `1`, `0`, `true`, or `false` directly to a function is ambiguous.
589
+
Passing literal `1`, `0`, `true`, or `false` directly to a function is
590
+
ambiguous.
589
591
590
-
These magic literals don’t explain what they mean. Consider using named constants or if you're the owner of the API and there's multiple arguments, consider introducing a struct argument
592
+
These magic literals don’t explain what they mean. Consider using named
593
+
constants or if you're the owner of the API and there's multiple arguments,
594
+
consider introducing a struct argument
591
595
592
596
**Config options:**
593
597
@@ -857,19 +861,17 @@ Enforces that container declarations are referenced.
857
861
858
862
## `require_braces`
859
863
860
-
> [!WARNING]
861
-
> The `require_braces` rule is still under testing and development. It may
862
-
> not work as expected and may change without notice.
863
-
864
864
Requires specific brace `{}` usage for the bodies of `if`, `else`, `while`,
865
865
`for`, `defer` and `catch` statements.
866
866
867
-
By requiring braces, you avoid ambiguity, make code easier to maintain,
868
-
and prevent unintended logic changes when adding new lines.
867
+
By requiring braces, you're consistent and avoid ambiguity, which can code
868
+
easier to maintain, and prevent unintended logic changes when adding new
869
+
lines.
869
870
870
871
If an `if` statement is used as part of a return or assignment it is excluded
871
-
from this rule (braces not required). For example, the following two examples
872
-
will be ignored by this rule.
872
+
from this rule (braces not required).
873
+
874
+
For example, the following two examples will be ignored by this rule.
0 commit comments