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: docs/en/contributing/StyleGuide.md
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,29 @@ This document contains general guidelines for writing code in the BSL Language S
4
4
5
5
Try to stick to them and the code review process will be simple.
6
6
7
-
## General recommendations
7
+
## Null values
8
8
9
9
If a method can legally return `null`, it is recommended that you return `Optional<T>` instead of explicitly returning `null`. Exceptions (eg. high frequency or performance functions) are negotiated separately.
10
10
11
+
The description of the `package-info.java` package must indicate that the NonNull API is used by default in the package.
12
+
To do this, the annotation `@DefaultAnnotation(NonNull.class)` is added above the package name
To explicitly indicate that a method can accept or return `null`, use the annotation `@edu.umd.cs.findbugs.annotations.Nullable`.
25
+
26
+
This avoids using the `@edu.umd.cs.findbugs.annotations.NonNull` annotation.
27
+
28
+
The `null` control annotations from the `javax.annotations` or `jetbrains.annotations` packages are not allowed.
29
+
11
30
## Formatting
12
31
13
32
1. All code in the modules should be automatically formatted.
@@ -56,6 +75,6 @@ To simplify the creation of a logger instance, it is recommended to use the `@lo
56
75
1. Connecting new libraries to the implementation scope should be done carefully, with control over the increase in the size of the resulting jar file. If possible, "unnecessary" and unused sub-dependencies should be excluded through `exclude`.
57
76
1. Explicit linking of the `com.google.guava`, `Google Collections` library or other parts of the Guava family of libraries is prohibited. **If absolutely necessary**, it is permissible to copy the implementation from `Guava` inside the BSL Language Server, subject to the terms of the Guava license. For everything else, there is Apache Commons.
58
77
1. Import of `*.google.*` classes, as well as other parts of Guava libraries, is prohibited. With no exceptions.
59
-
78
+
1. The `jsr305` package and its annotations should not be used in code. See section "Null values".
0 commit comments