Skip to content

Commit 9779ce2

Browse files
authored
Merge pull request #19752 from wordpress-mobile/feature/add-nullability-step-to-converting-to-kotlin-doc
Add nullability recommendation to the "Converting to Kotlin" documentation
2 parents f66f762 + 051372c commit 9779ce2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/converting-to-kotlin.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ When converting a file from Java to Kotlin, ensure you enable this option in And
1414
1. The first commit will involve a simple rename from `.java` to `.kt`.
1515
2. The second commit will rename the `.kt` extension back to .java, followed by the actual commit.
1616

17-
**Reason**: Enabling this option helps the reviewer perform a diff on the second commit, showing precisely what changes occurred between the Java and Kotlin files. Otherwise, the PR will display a file deletion (`.java` file) and a file addition (`.kt` file), making it challenging for the reviewer to diff effectively.
17+
**Reason:** Enabling this option helps the reviewer perform a diff on the second commit, showing precisely what changes occurred between the Java and Kotlin files. Otherwise, the PR will display a file deletion (`.java` file) and a file addition (`.kt` file), making it challenging for the reviewer to diff effectively.
18+
19+
### Consider adding nullability annotations before initiating automatic conversion:
20+
21+
Address the warnings of "Missing null annotation" before starting automatic conversion.
22+
23+
**Reason:** This makes automatic conversion to handle nullability instead of setting everything to nullable.
1824

1925
### Depend on automatic conversion and commit immediately:
2026

2127
When performing the conversion, rely on the automatic conversion tools and commit the changes promptly, even if the resulting Kotlin code doesn't compile. Subsequently, on another commit, you can refine the Kotlin code, making it more idiomatic or addressing any compilation issues, such as adding nullable checks (`!!` or `let`).
2228

23-
**Reason**: This approach informs the reviewer and other readers that the first commit involved an automated conversion without manual intervention. It helps establish that any code refinements occurred separately, providing clarity on the development process.
29+
**Reason:** This approach informs the reviewer and other readers that the first commit involved an automated conversion without manual intervention. It helps establish that any code refinements occurred separately, providing clarity on the development process.
2430

0 commit comments

Comments
 (0)