Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to configure diff tool by env variable #82

Merged
merged 5 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
433 changes: 232 additions & 201 deletions docs/diff-tool.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/mdsource/diff-tool.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ include: diffTools
snippet: DisableDiff


## Diff Tool order


### Default

include: defaultDiffToolOrder


### Custom order

Set an `Verify.DiffToolOrder` with the preferred order of diff tool resolution. The value can be comma (`,`), pipe (`|`), or space separated.

For example `VisualStudio,Meld` will result in VisualStudio then Meld then all other tools being the order.


## DiffEngine

**API SUBJECT TO CHNAGE IN MINOR RELEASES**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unable to parse tool from `Verify.DiffToolOrder` environment variable: Foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
'VisualStudio',
'Meld'
]
17 changes: 16 additions & 1 deletion src/DiffEngine.Tests/DiffToolsTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using DiffEngine;
using VerifyXunit;
using Xunit;
Expand All @@ -18,6 +20,19 @@ public class DiffToolsTest :
// Assert.True(DiffTools.IsDetectedFor(DiffTool.BeyondCompare, "png"));
//}

[Fact]
public Task ParseEnvironmentVariable()
{
return Verify(DiffTools.ParseEnvironmentVariable("VisualStudio,Meld"));
}

[Fact]
public Task BadEnvironmentVariable()
{
var exception = Assert.Throws<Exception>(() => DiffTools.ParseEnvironmentVariable("Foo").ToList());
return Verify(exception.Message);
}

[Fact]
public void WriteFoundTools()
{
Expand Down
17 changes: 17 additions & 0 deletions src/DiffEngine.Tests/defaultDiffToolOrder.include.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
* BeyondCompare
* P4Merge
* AraxisMerge
* Meld
* SublimeMerge
* Kaleidoscope
* CodeCompare
* WinMerge
* DiffMerge
* TortoiseMerge
* TortoiseGitMerge
* TortoiseIDiff
* KDiff3
* TkDiff
* VisualStudioCode
* VisualStudio
* Rider