Skip to content

Commit 3d2b458

Browse files
authored
Merge pull request #349 from domaframework/document/add-claude-code-document
Add CLAUDE.md documentation for plugin development guidance
2 parents 45e3c85 + 5c36df0 commit 3d2b458

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.claude/commands/execute_issue.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
gh issue view $ARGUMENTS to check the content of a GitHub Issue and proceed with the task.
2+
Follow the steps below to complete the task:
3+
4+
1. Review the content of the Issue.
5+
2. Checkout and pull the latest state of the main branch.
6+
3. Create and checkout an appropriate branch based on the Issue content.
7+
4. Implement test code and test files that cover the cases described in the Issue. Refer to the [Test Case Implementation Guidelines](../guidelines/TEST_CASE_GUIDELINE) for rules on implementing test cases.
8+
5. Run the tests and ensure all tests pass.
9+
6. Create commits with appropriate granularity.
10+
7. Create a PR following the rules below:
11+
- Refer to the [PR Creation Guidelines](../guidelines/CREATE_PR_GUIDELINE.md) for PR rules.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Commit Guidelines
2+
- Use imperative mood for commit messages (e.g., "Fix bug" instead of "Fixed
3+
- Write Commit messages in English
4+
5+
## PR Guidelines
6+
- If there are unstaged changes when creating a pull request, please split them appropriately and commit them separately.
7+
- Use the [PR Template](../templates/PR_TEMPLATE.md) for PR descriptions
8+
- PR titles should be concise and descriptive
9+
- Ensure all tests pass before submitting a PR
10+
- Write PR title and descriptions in English
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Test Case Implementation Guidelines
2+
Follow the rules below when implementing test code.
3+
4+
## Code Inspection Functionality
5+
Implement tests for code inspection functionality using the following steps:
6+
7+
### **Implementation of Test Case Classes**
8+
- Implement test case classes in `@src/test/kotlin/org/domaframework/doma/intellij/inspection`.
9+
- Implement test cases for each subclass of **AbstractBaseJavaLocalInspectionTool**.
10+
- Name the test case class as `<InspectionToolName>InspectionTest`.
11+
- The test case class should extend `DomaSqlTest`.
12+
- Override **setUp()** to add mock **Entity** classes or other necessary components to the virtual project for testing.
13+
- Register the target **AbstractBaseJavaLocalInspectionTool** subclass using **myFixture.enableInspections**.
14+
- In test case functions, retrieve the target Dao class using **DomaSqlTest#findDaoClass()** and test the highlighting results using **myFixture.testHighlighting()**.
15+
16+
### Implementation of Test Cases
17+
Create the target Dao class or SQL file for inspection.
18+
Wrap the elements to be error-highlighted with the **<error>** tag and specify the error message to be displayed using the **descr** option.
19+
20+
#### Test Data for Dao Classes
21+
- Implement test data Dao classes in **Java**.
22+
- Annotate test data Dao classes with **@Dao**.
23+
- Place them under the appropriate subpackage in `@src/test/testData/src/main/java/doma/example/dao/inspection`.
24+
- Implement any other necessary classes as needed.
25+
26+
#### Test Data for SQL Files
27+
- Create and place SQL files in a directory named after the corresponding Dao class under `@src/test/testData/src/main/resources/META-INF/doma/example/dao`.
28+
29+
### Reference
30+
For actual implementation examples using Doma, refer to the [Doma GitHub repository](https://github.com/domaframework/doma/tree/master/integration-test-java/src/main/java/org/seasar/doma/it/dao).

0 commit comments

Comments
 (0)