matcher-combinators

borkdude 2025-08-05T10:49:28.255889Z

Any tips and tricks for preventing unbearably long output when comparing long seqs of maps where only some maps in the middle are different?

Phillip Mates 2025-08-05T10:51:55.616319Z

(matcher-combinators.config/enable-abbreviation!) it is experimental and I've found it to be annoying at times (though I have it on by default)

Phillip Mates 2025-08-05T10:52:15.817379Z

(I guess the context is in https://github.com/nubank/matcher-combinators/pull/214)

borkdude 2025-08-05T10:52:45.167289Z

thanks. my context: https://github.com/clj-kondo/clj-kondo/actions/runs/16747800247/job/47410397807

borkdude 2025-08-05T10:55:37.148359Z

Now the output is much better, but ... now it's kind of hard to see where to look laughcry

FAIL in (clj-kondo-diff-test) (diff_test.clj:39)
expected: (match? (clojure.core/map clj-kondo.test-utils/normalize-map-paths expected__20564__auto__) (clojure.core/map clj-kondo.test-utils/normalize-map-paths actual__20563__auto__))
  actual: (...
 {:end-row (mismatch (expected 211) (actual 210)),
  :row (mismatch (expected 211) (actual 210))}
 {:end-row (mismatch (expected 212) (actual 211)),
  :row (mismatch (expected 212) (actual 211))}
 {:end-row (mismatch (expected 213) (actual 212)),
  :row (mismatch (expected 213) (actual 212))}
 {:end-row (mismatch (expected 215) (actual 214)),
  :row (mismatch (expected 215) (actual 214))}
 {:end-row (mismatch (expected 216) (actual 215)),
  :row (mismatch (expected 216) (actual 215))}
 {:end-row (mismatch (expected 225) (actual 224)),
  :row (mismatch (expected 225) (actual 224))}
 {:end-row (mismatch (expected 229) (actual 228)),
  :row (mismatch (expected 229) (actual 228))}
 {:end-row (mismatch (expected 243) (actual 242)),
  :row (mismatch (expected 243) (actual 242))}
 {:end-row (mismatch (expected 249) (actual 248)),
  :row (mismatch (expected 249) (actual 248))}
 {:end-row (mismatch (expected 253) (actual 252)),
  :row (mismatch (expected 253) (actual 252))}
 {:end-row (mismatch (expected 260) (actual 259)),
  :row (mismatch (expected 260) (actual 259))}
 {:end-row (mismatch (expected 262) (actual 261)),
  :row (mismatch (expected 262) (actual 261))}
 {:end-row (mismatch (expected 269) (actual 268)),
  :row (mismatch (expected 269) (actual 268))}
 {:end-row (mismatch (expected 273) (actual 272)),
  :row (mismatch (expected 273) (actual 272))}
 {:end-row (mismatch (expected 277) (actual 276)),
  :row (mismatch (expected 277) (actual 276))})

Phillip Mates 2025-08-05T10:55:58.820139Z

yeah, that is my problem with the feature as well

borkdude 2025-08-05T10:56:46.136739Z

Maybe I should transform the output first and then diff as just plain text

borkdude 2025-08-05T11:02:52.628699Z

difftastic is kind of good here:

borkdude 2025-08-05T11:13:17.194669Z

it's kind of a drag to install difftastic everywhere in my CI envs so I tried deep-diff2 but it does something similar:

[{:end-row -210 +211, :row -210 +211}
 {:end-row -211 +212, :row -211 +212}
 {:end-row -212 +213, :row -212 +213}
 {:end-row -214 +215, :row -214 +215}
 {:end-row -215 +216, :row -215 +216}
 {:end-row -224 +225, :row -224 +225}
 {:end-row -228 +229, :row -228 +229}
 {:end-row -242 +243, :row -242 +243}
 {:end-row -248 +249, :row -248 +249}
 {:end-row -252 +253, :row -252 +253}
 {:end-row -259 +260, :row -259 +260}
 {:end-row -261 +262, :row -261 +262}
 {:end-row -268 +269, :row -268 +269}
 {:end-row -272 +273, :row -272 +273}
 {:end-row -276 +277, :row -276 +277}]