jatcwang / jatcwang/difflicious

Custom record (object) differ

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
108
Forks
13
Avg merge
13h 7m
Merged PRs (30d)
34

Description

Sometimes we have a record-like class which we'll want to compare a subset of fields.

e.g.

class MyError(field1: String, field2: List[String], cause: Throwable) extends Exception we may only want to compare msg since cause isn't something we can/want to compare.

Ideally we can have have an easy way to create custom record differs, maybe something like:

val differ = Differ.customObj(_.msg, _.field2)

where customObj is overloaded to accept any number of params.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed Differ.customObj API and the MyError example in the issue. Determine how selecting msg and field2 should define comparison while excluding cause, and what overloads are needed for any number of fields. Done means a custom record differ can compare the selected subset with clear behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.