Skip to content

Implement custom diffs. #35

@SebastianStehle

Description

@SebastianStehle

New Feature Proposal

Description

At the moment the diffs are not very meaningful. If you implement a custom diff logic, you cannot tell later what kind of diff it actually is. So to use the diffs you need a lot of switches and you have to repeat the logic of the filters.

e.g. we use this code: https://github.com/SebastianStehle/mjml-net/blob/5bbb6f3c9e97a33a8657a50d9921cb779d92fba5/Tests/Internal/AssertHelpers.cs#L134

Furthermore the texts for the diffs are only available via DebuggerDisplay attribute.

What I would like to see is:

  1. More types for diffs (e.g. each case you should be its own class.
  2. Implement "ToString()" instead of debugger display.
  3. Override the diff in the filters.

e.g. the FilterStrategy could be changed to:

public delegate (IDiff? Diff, FilterDecision) FilterStrategy<TSource>(in TSource source, FilterDecision currentDecision)

Because the version is lower than 1.0 I do not see a problem to just change that, but it would not be a problem to add a new filter strategy and to implement the old logic using the new logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions