Skip to content

Conversation

@martinemde
Copy link
Contributor

Summary

  • Removes unnecessary adapter classes from PksOffense that provided Packwerk::ReferenceOffense compatibility
  • Simplifies the offense data model by using direct property access
  • Updates formatters and tests to use the simplified interface

Test plan

  • All 101 RSpec tests pass
  • No changes to public API behavior

Remove the adapter classes (PackageAdapter, ConstantAdapter,
ReferenceAdapter, LocationAdapter) from PksOffense that existed solely
to make it compatible with Packwerk::ReferenceOffense interface.

Instead, use PksOffense's direct properties throughout:
- offense.constant_name instead of offense.reference.constant.name
- offense.file instead of offense.reference.relative_path
- offense.line instead of offense.location.line
- offense.defining_pack_name instead of offense.reference.constant.package.name

Update Check::OffensesFormatter interface to accept PksOffense directly
instead of Packwerk::ReferenceOffense, and update DefaultFormatter to
resolve constant locations via Private.constant_resolver.

Closes dp-5q5
@github-project-automation github-project-automation bot moved this to Triage in Modularity Jan 9, 2026
@martinemde martinemde changed the base branch from main to pks-integration-polish January 9, 2026 03:07
@martinemde
Copy link
Contributor Author

Merging into #62

@martinemde martinemde merged commit ed3f191 into pks-integration-polish Jan 9, 2026
6 checks passed
@martinemde martinemde deleted the refinery/simplify-offense-model branch January 9, 2026 03:09
@github-project-automation github-project-automation bot moved this from Triage to Done in Modularity Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants