Skip to content

Commit 8251639

Browse files
committed
0 Document coding guideline: Add section on blank lines after variable modifications (Java) to improve readability.
1 parent 450e46f commit 8251639

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

CLAUDE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,21 @@ public class ExampleComponentHandler implements ComponentHandler {
241241
}
242242
```
243243

244+
### Blank Line After Variable Modification (Java)
245+
- Insert exactly one empty line between a variable modification and a subsequent statement that uses that variable
246+
- This improves readability by visually separating the setup from the usage
247+
- Example:
248+
```java
249+
// Bad
250+
document.setStatus(KnowledgeBaseDocument.STATUS_PROCESSING);
251+
knowledgeBaseDocumentService.saveKnowledgeBaseDocument(document);
252+
253+
// Good
254+
document.setStatus(KnowledgeBaseDocument.STATUS_PROCESSING);
255+
256+
knowledgeBaseDocumentService.saveKnowledgeBaseDocument(document);
257+
```
258+
244259
### Method Chaining
245260
- Do not chain method calls except where this is natural and idiomatic
246261
- Allowed exceptions (non-exhaustive):

0 commit comments

Comments
 (0)