You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ The usual Gradle commands, plus:
32
32
33
33
-**State Tree**: Immutable user-supplied in-memory tree structure composed mostly of records
34
34
-**ReadSession**: Coarse-grained snapshot-at-start semantics (e.g. one per HTTP request)
35
-
-**Drivers**: Pluggable layers for processing state updates
35
+
-**Drivers**: Pluggable layers for processing state updates; drivers form a _stack_, or chain, with updates passed along from one to the next until they reach the in-memory state tree
36
36
-**Hooks**: Callbacks for state change notifications
37
37
-**References**: Type-safe "pointers" into the state tree
38
38
@@ -79,6 +79,17 @@ and try to answer that question in the javadocs.
79
79
80
80
We use Lombok sparingly. Most of its features are disabled in lombok.config.
81
81
82
+
### What to avoid
83
+
84
+
- Do not use Mockito or other mocking libraries for tests.
85
+
Mockito is a phenomenal solution to the wrong problem.
86
+
Our components are designed to be stateless and to use immutable structures
87
+
so that mocks are almost never necessary. If you think you need a mock, reconsider the design first.
88
+
- Don't merge wildcard imports. You can use them temporarily but they must be expanded before merging.
89
+
Spotless will enforce this.
90
+
- Tests should not emit logs unless something unexpected occurs.
91
+
- Use `bosk-logback/src/main/java/works/bosk/logback/BoskLogFilter.java` to suppress expected production logs in tests.
92
+
82
93
## Testing Patterns
83
94
84
95
- Tests use JUnit 5
@@ -104,8 +115,9 @@ We use Lombok sparingly. Most of its features are disabled in lombok.config.
104
115
- We use spotbugs for shipped code
105
116
- Published to Maven Central via GitHub actions, by creating a new release in GitHub
106
117
- We use GitHub Dependabot to keep dependencies very up-to-date
107
-
- We use bytecode generation for high performance in several places.
108
-
- Abstractions are designed to support this by specifying things once and then using them many times (e.g. "compiling" a `Path` into a `Reference`) even where we don't yet take advantage
118
+
- We separate setup from execution. Prefer designs where work is described once (at construction/configuration time) and executed many times efficiently.
119
+
-`Reference` is an example: path parsing and validation happen once when the `Reference` is built, and then reads are fast.
120
+
Apply this pattern when designing new abstractions — avoid doing expensive setup work inside hot paths.
109
121
- Each published subproject may have its own developer documentation (e.g. [bosk-mongo/DEVELOPERS.md](bosk-mongo/DEVELOPERS.md))
110
122
- Changes to those subprojects should first consult that documentation for further guidance, and even update it if necessary
0 commit comments