Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,18 @@ This SDK is designed to be **lightweight with minimal dependencies**:
5. Check for security vulnerabilities
6. Get team approval for non-trivial additions

## Pre-commit Hooks and Formatting (Coding Agent)

The repository has a pre-commit hook (`.githooks/pre-commit`) that is **automatically enabled** in the Copilot coding agent environment via `copilot-setup-steps.yml`. The hook runs `mvn spotless:check` on any commit that includes changes under `src/`.

Comment on lines +247 to +250
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new section says the pre-commit hook is “automatically enabled” via copilot-setup-steps.yml, but earlier in the same document (and in CONTRIBUTING/README) the hook is described as something developers must manually enable with git config core.hooksPath .githooks. Please clarify the scope (e.g., auto-enabled only in the Copilot coding agent environment; local development still requires manual enablement) to avoid conflicting guidance, and consider linking explicitly to .github/workflows/copilot-setup-steps.yml for precision.

Copilot uses AI. Check for mistakes.
**If a commit fails due to the pre-commit hook:**

1. Run `mvn spotless:apply` to auto-fix formatting issues.
2. Re-stage the changed files with `git add -u`.
3. Retry the commit.

**Best practice:** Always run `mvn spotless:apply` before committing Java source changes to avoid hook failures in the first place. If you forget and the hook rejects the commit, follow the three steps above and continue.

## Commit and PR Guidelines

### Commit Messages
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
distribution: 'temurin'
cache: 'maven'

# Enable repository pre-commit hooks (including Spotless checks for relevant source changes)
- name: Enable pre-commit hooks
run: git config core.hooksPath .githooks

# Verify installations
- name: Verify tool installations
run: |
Expand All @@ -50,4 +54,6 @@ jobs:
java -version
gh --version
gh aw version
echo "--- Git hooks path ---"
git config core.hooksPath
echo "✅ All tools installed successfully"
Loading