Repository navigation
feat: add custom reporters - #16
Merged
Merged
Conversation
Public CognitiveReporter and ChurnReporter interfaces with immutable input records in report.spi. A reporter is registered under customReporters.<command>.<key> with a class and an optional jar, resolved against the directory of the config file. Custom keys may not collide with built-in report types.
Catch linkage errors from render, reject null output, unwrap initializer and reflection wrappers in messages, run reporters with their own context class loader, and check key collisions when a reporter of the command is resolved so config no longer depends on the report packages.
Churn reports, built-in and custom, are now written with AtomicFileWriter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
report.spi:CognitiveReporter,ChurnReporterand immutable input records, mapped from the domain so no internal classes are exposed.customReporters.{cognitive,churn}.<key>: {class, jar}is now applied. The jar is resolved against the directory of the config file and loaded with a URLClassLoader whose parent is the application loader. The class needs a public no-argument constructor.-r <key>resolves built-in types first. A custom key that equals a built-in type name (any case, same command) is a config error at load. Invalid-type messages and the option help list the custom keys.Test plan
./mvnw -B verify: green. JaCoCo 97.2% line, 95.2% branch. PIT 99% (886/887),report.*added to the targets.