-
Notifications
You must be signed in to change notification settings - Fork 4
Integrate automatic code formatting with git hooks and documentation #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enforces Google Java Style formatting using Spotify's fmt-maven-plugin with optional git hooks and documentation. The changes primarily apply automated formatting to existing test and source files to ensure code consistency.
- Reformats test files to follow Google Java Style guidelines (indentation, line breaks, spacing)
- Reformats source files including validators, model classes, and validation constraints
- Updates Javadoc comments to use more concise formatting
Reviewed changes
Copilot reviewed 191 out of 192 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| Test files (VariantValidatorForUuidTests.java, StatementsValidatorTest.java, etc.) | Applied automated formatting to test methods, builder patterns, and assertions |
| Validator source files (StatementVerbValidator.java, ActorValidator.java, etc.) | Reformatted code structure and Javadoc comments |
| Model source files (SubStatement.java, StatementResult.java, etc.) | Reformatted Javadoc and code structure |
| Validation constraint files (Variant.java, ValidActor.java, etc.) | Simplified Javadoc formatting |
|


Description
Enforces Google Java Style formatting via Spotify's fmt-maven-plugin using optional git hooks and comprehensive documentation for both human and AI contributors.
Changes
Git Hook Infrastructure
.githooks/pre-commit- Automatically runs fmt-maven-plugin before commits, staging formatted filesinstall-git-hooks.sh- One-command setup script that configures git to use custom hooks directoryDocumentation
CONTRIBUTING.md- Added "Automated Formatting" section with installation and manual formatting instructions; updated PR checklist.github/copilot-instructions.md- Added "Code Formatting" section to inform Copilot of formatting requirements.githooks/README.md- Documents hook behavior and usageUsage
Install hook (recommended):
Manual formatting:
Disable hook:
Checklist:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkstyle.org/opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/xapi-java/.codeql-scratch/dbs/java/working/files-to-index10508208780964532575.list --sourceArchiveDir=/home/REDACTED/work/xapi-java/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/xapi-java/.codeql-scratch/dbs/java/trap/java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.