Skip to content

Commit

Permalink
Rename DenyGlobs back to original Globs to avoid breaking change when…
Browse files Browse the repository at this point in the history
… using options-json argument.
  • Loading branch information
gfs committed Dec 6, 2024
1 parent 673d70b commit fcd0292
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public int Run()

IEnumerable<FileEntry> fileListing;
Extractor extractor = new Extractor();
ExtractorOptions extractorOpts = new ExtractorOptions() { ExtractSelfOnFail = false, AllowFilters = _opts.AllowGlobs, DenyFilters = _opts.DenyGlobs };
ExtractorOptions extractorOpts = new ExtractorOptions() { ExtractSelfOnFail = false, AllowFilters = _opts.AllowGlobs, DenyFilters = _opts.Globs };
// Analysing a single file
if (!Directory.Exists(fullPath))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public record BaseAnalyzeCommandOptions : LogOptions
public IEnumerable<Confidence> Confidences { get; set; } = new[] { Confidence.High, Confidence.Medium };

[Option('g', "ignore-globs", HelpText = "Comma-separated Globs for files to skip analyzing", Separator = ',', Default = new[] { "**/.git/**", "**/bin/**" })]
public IEnumerable<string> DenyGlobs { get; set; } = new[] { "**/.git/**", "**/bin/**" };
public IEnumerable<string> Globs { get; set; } = new[] { "**/.git/**", "**/bin/**" };

[Option("include-globs", HelpText = "If set, files must match one of these globs to be analyzed", Separator = ',', Default = new string[]{})]
public IEnumerable<string> AllowGlobs { get; set; } = new string[]{};
Expand Down
6 changes: 3 additions & 3 deletions DevSkim-DotNet/Microsoft.DevSkim.Tests/OptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void TestExcludeGlobs()
{
Severities = new[] { Severity.Critical | Severity.Important },
ExitCodeIsNumIssues = true,
DenyGlobs = new List<string>() {"*.js"}
Globs = new List<string>() {"*.js"}
};
var testContent = "Hello World";
var testRule =
Expand Down Expand Up @@ -154,7 +154,7 @@ public void TestIncludeAndExcludeGlobs()
Severities = new[] { Severity.Critical | Severity.Important },
ExitCodeIsNumIssues = true,
AllowGlobs = new List<string>() {"*.js"},
DenyGlobs = new List<string>() {"*hello.js"}
Globs = new List<string>() {"*hello.js"}
};
var testContent = "Hello World";
var testRule =
Expand Down Expand Up @@ -234,7 +234,7 @@ public void TestParsingJsonOptions()
{
Severities = new[] { Severity.Critical | Severity.Important },
ExitCodeIsNumIssues = true,
DenyGlobs = new List<string>() {"*.js"}
Globs = new List<string>() {"*.js"}
};
// Serialize it to a file
// Include world twice so we can disinguish between the two rules
Expand Down

0 comments on commit fcd0292

Please sign in to comment.