ajantha-bhat commented on code in PR #12641: URL: https://github.com/apache/iceberg/pull/12641#discussion_r2013474931
########## site/docs/contribute.md: ########## @@ -422,6 +422,50 @@ Use `this` when assigning values to instance variables, making it clear when the 2. Use `.` to create a hierarchy of config groups * For example, `s3` in `s3.access-key-id`, `s3.secret-access-key` +#### Block Spacing + +To improve readability and maintain consistency, always place a newline after control blocks (if, for, while, switch, etc.). +This helps separate logical sections of the code, making it easier to read and debug. + +```java + // BAD: No newline separator after `if` block + public static WriteBuilder write(OutputFile file) { + if (file instanceof EncryptedOutputFile) { + return write((EncryptedOutputFile) file); + } + return new WriteBuilder(file); + } + + // GOOD: newline separator after `if` block + public static WriteBuilder write(OutputFile file) { + if (file instanceof EncryptedOutputFile) { + return write((EncryptedOutputFile) file); + } + + return new WriteBuilder(file); + } + + // BAD: No newline separator before and after `for` block + public static Schema convert(Schema schema) { + ImmutableList.Builder<Field> fields = ImmutableList.builder(); + for (NestedField f : schema.columns()) { + fields.add(convert(f)); + } + return new Schema(fields.build()); + } + + // GOOD: newline separator before and after `for` block Review Comment: But some places they follow it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org