Skip to content

Commit 26a4b09

Browse files
LarsEckartclaude
andcommitted
. e Add Claude Code configuration for repository
- Created CLAUDE.md with project overview, architecture, and development commands - Added .claude/settings.local.json to .gitignore to exclude local settings This provides essential context for future Claude Code instances to work effectively in this repository while keeping local configuration private. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9da7f03 commit 26a4b09

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ __pycache__/
2323
**/.jqwik-database
2424
*.bak
2525

26-
.gitmessage
26+
.gitmessage
27+
28+
# Claude Code local settings
29+
.claude/settings.local.json

CLAUDE.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
ApprovalTests.Java is a snapshot-based testing library that simplifies assertions by comparing expected output to approved files. The library supports JUnit 3/4/5 and TestNG, and works with JDK 1.8-25.
8+
9+
## Architecture
10+
11+
This is a multi-module Maven project with the following key modules:
12+
13+
- **approvaltests**: Main library containing core functionality (`Approvals.java`, writers, reporters, namers)
14+
- **approvaltests-util**: Shared utilities and helper classes
15+
- **approvaltests-tests**: Integration tests and examples
16+
- **approvaltests-util-tests**: Tests for utility classes
17+
- **counter_display**: Sample application
18+
- **html_locker**: Additional tooling
19+
20+
The core API is in `org.approvaltests.Approvals` class, which provides static methods like `verify()`, `verifyAll()`, `verifyAsJson()`. The library uses a pattern of Writers (generate output), Namers (determine file names), and Reporters (show differences when tests fail).
21+
22+
## Common Commands
23+
24+
### Build and Test
25+
```bash
26+
# Full build with all tests
27+
mvn install
28+
29+
# Build and test (recommended)
30+
./build_and_test.sh
31+
32+
# Skip tests if some are machine/locale dependent
33+
mvn install -DskipTests
34+
35+
# Run tests for specific module
36+
mvn verify -pl approvaltests-tests/
37+
```
38+
39+
### Development
40+
```bash
41+
# Format code
42+
mvn formatter:format
43+
44+
# Run just the main tests
45+
./run_tests_without_compile_dependencies.sh
46+
```
47+
48+
## Key Files and Concepts
49+
50+
- **Approved files**: `*.approved.*` files must be committed to source control and treated as binary in git (add `*.approved.* binary` to `.gitattributes`)
51+
- **Received files**: Generated during test failures, showing actual output vs approved
52+
- **Reporters**: Tools that show diffs when tests fail (IntelliJ, Beyond Compare, etc.)
53+
- **Namers**: Determine approval file naming based on test method/class
54+
- **Writers**: Generate the actual content to be approved
55+
56+
## Running Single Tests
57+
58+
Individual test methods can be run using standard Maven/IDE approaches:
59+
```bash
60+
mvn test -Dtest=ClassName#methodName
61+
```
62+
63+
## Code Style
64+
65+
The project uses the formatter plugin with configuration in `spun.xml`. Code formatting is enforced via Maven build.

0 commit comments

Comments
 (0)