-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate ref-checking with analyzers and app.
All analyzers now optionally take a reference checker and will execute it, and the unit tests enforce that every analyzer does support and properly use the parameter. EasyNPC app now configures the full import expansions for NPCs - that is, all of the possible paths that can cause a build to fail. For now, these are only reported as warnings in the log. They'll need to be turned into a decent UI. Note: This adds a non-trivial amount of startup time, perhaps between 0.5-1 sec. Consider adding a command-line flag for advanced users to turn it off. #107
- Loading branch information
1 parent
f6dd9be
commit c4e9419
Showing
13 changed files
with
170 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Focus.Providers.Mutagen.Tests/Analysis/FakeReferenceChecker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Focus.Analysis.Records; | ||
using Focus.Providers.Mutagen.Analysis; | ||
using Mutagen.Bethesda.Skyrim; | ||
using System.Collections.Generic; | ||
|
||
namespace Focus.Providers.Mutagen.Tests.Analysis | ||
{ | ||
class FakeReferenceChecker : IReferenceChecker | ||
{ | ||
public IEnumerable<ReferencePath> InvalidPaths { get; set; } | ||
|
||
public IReferenceChecker<T> Of<T>() | ||
{ | ||
return new CheckerOf<T>(this); | ||
} | ||
|
||
public IEnumerable<ReferencePath> GetInvalidPaths(ISkyrimMajorRecordGetter record) | ||
{ | ||
return InvalidPaths; | ||
} | ||
|
||
class CheckerOf<T> : IReferenceChecker<T> | ||
{ | ||
private readonly FakeReferenceChecker parentChecker; | ||
|
||
public CheckerOf(FakeReferenceChecker parentChecker) | ||
{ | ||
this.parentChecker = parentChecker; | ||
} | ||
|
||
public IEnumerable<ReferencePath> GetInvalidPaths(T record) | ||
{ | ||
return parentChecker.InvalidPaths; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.