Skip to content

Commit 18bd7f9

Browse files
Start giving Junie some code-generation guidelines (#1243)
* Start giving Junie some code-generation guidelines * Remind Junie to use the existing formatting rules
1 parent 1fe9950 commit 18bd7f9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.junie/guidelines/formatting.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Code Formatting Guidelines
2+
3+
- All code formatting must strictly adhere to the IntelliJ IDEA project settings defined in `.idea/codeStyles/Project.xml`.
4+
- Read and follow the specific rules configured in that file for all supported languages (Java, JavaScript, TypeScript, CSS, Python, etc.).

.junie/guidelines/java.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Java Coding Guidelines
2+
3+
#### General
4+
- Prefer `Stream` API over traditional for-loops for collection processing.
5+
- Whenever possible, use try-with-resources for automatic resource management.
6+
- Always ask before adding, removing, or updating a third-party library dependency.
7+
- Always use org.jetbrains.annotations.NotNull and org.jetbrains.annotations.Nullable for nullability annotations.
8+
- Be explicit about nullability in public API method signatures.
9+
10+
#### Logging
11+
- Use Log4J2 for logging.
12+
- Name the static logger `LOG` and initialize it using `org.labkey.api.util.logging.LogHelper.getLogger()`.
13+
14+
#### Testing
15+
- For unit tests, create a static `TestCase` inner class extending `Assert` in the same file as production code.
16+
- Add new `TestCase` classes to the owning module's list in `getUnitTests()`
17+
- Use JUnit 4 annotations (e.g., @Test) for these inner test classes.

0 commit comments

Comments
 (0)