chore: format spanner samples#13228
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements widespread formatting updates and minor cleanups across a large number of Java Spanner sample snippets, primarily focusing on indentation, line wrapping, and comment tag consistency. While most changes are stylistic, a critical compilation error was identified in AsyncRunnerExample.java due to the removal of the TransactionContext import, which is still required by the implementation.
| @@ -30,7 +29,6 @@ | |||
| import com.google.cloud.spanner.SpannerOptions; | |||
| import com.google.cloud.spanner.Statement; | |||
There was a problem hiding this comment.
These two imports are not used in this file.
|
I think this was done specifically since this is being in customer facing docs. We expect the code that is visible in public document to be in certain format to look better (may not be the same format as we do in our code). |
|
@sakthivelmanii do you have any docs mentioning that? And public docs don't have any restriction on format. https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md#style |
|
@rahul2393 I am not saying that we shouldn't do this. My concern is that we have done it in this way probably because we had concerns with the formatting in the past. We should clarify with the docs team before we do this change is what I am suggesting. (Since samples was explicitly removed in googleapis/synthtool#1295 maybe because formatting is reducing the snippet clarity or some other reason). |
|
@zhumin8 Looks like the spanner team has concerns about formatting the samples. How about we excluding the samples from formatting for now to unblock the migration. We can format the samples when we get a response from the spanner team. |
Format samples in spanner.
The samples are excluded from formatting in googleapis/synthtool#1295. There's no explanation for the change so I assume old formatter failed to format the code.
We can format the samples with the new formatter now, doing so can remove the hardcoded logic in librarian.
For googleapis/librarian#6011