diff --git a/.claude/commands/create_pr.md b/.claude/commands/create_pr.md new file mode 100644 index 00000000..ed72d6c1 --- /dev/null +++ b/.claude/commands/create_pr.md @@ -0,0 +1,39 @@ +# PR Creation Rules +This document describes the format and rules for creating a Pull Request (PR) on GitHub. + +# Execution Details +## Commit Guidelines +- Use imperative mood for commit messages (e.g., "Fix bug" instead of "Fixed +- Write Commit messages in English + +## PR Guidelines +- If there are unstaged changes when creating a pull request, please split them appropriately and commit them separately. +- When using the gh command, first authenticate with ```gh auth login```. +- Use the [PR Template](../templates/PR_TEMPLATE.md) for PR descriptions +- PR titles should be concise and descriptive +- Ensure all tests pass before submitting a PR +- Write PR title and descriptions in English + +## Command to Execute + +To create a PR, execute the following command. Add options as needed to construct the title, body, etc. +```bash +gh pr create +``` + +The rules for describing the content of the PR are as follows. +## Title +Follow these rules for the PR title: +- Write the title in English. +- Keep the title concise and clearly indicate the changes. + +## Body +Follow these rules for the PR body: +- Write the body in English. +- It is recommended to divide the body into the following sections: + - Refer to the [PR Template](../templates/PR_TEMPLATE.md) for the PR body template. +- Briefly explain the purpose and impact of the changes. +- Include related issue numbers or ticket numbers, if possible. + +## Labels +Labels are automatically assigned by GitHub Actions, so no manual configuration is required. diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000..e0b0bdd8 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,8 @@ +{ + "permissions": { + "allow": [ + "Bash(./gradlew test:*)" + ], + "deny": [] + } +} \ No newline at end of file diff --git a/.claude/templates/PR_TEMPLATE.md b/.claude/templates/PR_TEMPLATE.md new file mode 100644 index 00000000..67d4b394 --- /dev/null +++ b/.claude/templates/PR_TEMPLATE.md @@ -0,0 +1,21 @@ +**Description** + +--- +**Related Issue** + +--- +**Type of Change** +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation update +- [ ] Other (please specify) +- [ ] Refactor +- [ ] Test +- [ ] Build system change +- [ ] Chore +- [ ] Performance improvement +- [ ] Code style update +- [ ] Security fix +- [ ] Other (please specify) + +--- diff --git a/.github/prompt/GenerateCommitComment.prompt.md b/.github/prompt/GenerateCommitComment.prompt.md new file mode 100644 index 00000000..c8c5071b --- /dev/null +++ b/.github/prompt/GenerateCommitComment.prompt.md @@ -0,0 +1,13 @@ +# Generate Commit Messages in English + +## Purpose +Generate an English commit message based on the provided description of code changes. + +## Instruction +Please create a concise and clear **commit message in English** for the described modifications. + +## Input +- A description of what was changed or implemented in the code (in any language) + +## Output +- A corresponding commit message in English that reflects the intent and content of the changes diff --git a/CLAUDE.md b/CLAUDE.md index 29e02c2d..b0b80e27 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -30,6 +30,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co # Verify plugin compatibility ./gradlew verifyPlugin ``` + --- ## Architecture Overview diff --git a/src/test/testData/sql/formatter/blockdemo.sql b/src/test/testData/sql/formatter/blockdemo.sql new file mode 100644 index 00000000..e20a764c --- /dev/null +++ b/src/test/testData/sql/formatter/blockdemo.sql @@ -0,0 +1,4 @@ +/**content +* Content Main +* This is a demonstration of how to format SQL code using block comments. +*/ \ No newline at end of file diff --git a/src/test/testData/src/main/java/doma/example/dao/formatter/SqlInjectionFormatDao.java b/src/test/testData/src/main/java/doma/example/dao/formatter/SqlInjectionFormatDao.java new file mode 100644 index 00000000..740bb385 --- /dev/null +++ b/src/test/testData/src/main/java/doma/example/dao/formatter/SqlInjectionFormatDao.java @@ -0,0 +1,23 @@ +package doma.example.dao.formatter; + +import doma.example.entity.Employee; +import org.seasar.doma.Dao; +import org.seasar.doma.Select; +import org.seasar.doma.Sql; + +@Dao +public interface SqlInjectionDao { + @Select + @Sql(""" +SELECT * + FROM tableName + WHERE id = 0""") + Employee selectInjection(); + + @Select + @Sql(""" +SELECT * + FROM tableName + WHERE id = /* id */1""") + Employee selectInjection2(Integer id); +} \ No newline at end of file