Skip to content

Commit

Permalink
#392: Filters are now case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpalme committed Oct 10, 2020
1 parent 11c2692 commit c3c0838
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ variables:
- name: disable.coverage.autogenerate
value: 'true'
- name: version
value: '4.7.0'
value: '4.7.1'

stages:
- stage: Build
Expand Down
2 changes: 1 addition & 1 deletion src/AzureDevopsTask/ReportGenerator/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 4,
"Minor": 7,
"Patch": 0
"Patch": 1
},
"instanceNameFormat": "ReportGenerator",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion src/AzureDevopsTask/vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "reportgenerator",
"name": "ReportGenerator",
"version": "4.7.0",
"version": "4.7.1",
"publisher": "Palmmedia",
"public": true,
"targets": [
Expand Down
4 changes: 4 additions & 0 deletions src/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ For further details take a look at LICENSE.txt.

CHANGELOG

4.7.1.0

* New: #392: Filters are now case insensitive

4.7.0.0

* New: Dropped support for Nuget package 'dotnet-reportgenerator-cli'. Use 'dotnet-reportgenerator-globaltool' instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<AssemblyName>ReportGenerator</AssemblyName>
<RootNamespace>Palmmedia.ReportGenerator</RootNamespace>
<StartupObject>Palmmedia.ReportGenerator.Console.NetCore.Program</StartupObject>
<AssemblyVersion>4.7.0.0</AssemblyVersion>
<FileVersion>4.7.0.0</FileVersion>
<AssemblyVersion>4.7.1.0</AssemblyVersion>
<FileVersion>4.7.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/ReportGenerator.Console/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.7.0.0")]
[assembly: AssemblyFileVersion("4.7.0.0")]
[assembly: AssemblyVersion("4.7.1.0")]
[assembly: AssemblyFileVersion("4.7.1.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public void NoFilter_AnyElement_ElementIsAccepted()
IFilter filter = new DefaultFilter(new string[] { });

Assert.True(filter.IsElementIncludedInReport("Test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test"), "Element is expected to be included.");
Assert.False(filter.HasCustomFilters);
}

Expand All @@ -24,6 +25,7 @@ public void OnlyIncludes_MatchingElement_ElementIsAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test" });

Assert.True(filter.IsElementIncludedInReport("Test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test"), "Element is expected to be included.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -33,6 +35,7 @@ public void OnlyIncludes_NotMatchingElement_ElementIsNotAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test" });

Assert.False(filter.IsElementIncludedInReport("Test123"), "Element is expected to be excluded.");
Assert.False(filter.IsElementIncludedInReport("test123"), "Element is expected to be excluded.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -42,7 +45,9 @@ public void OnlyIncludesWithWildcards_MatchingElement_ElementIsAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test*" });

Assert.True(filter.IsElementIncludedInReport("Test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("Test123"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test123"), "Element is expected to be included.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -52,7 +57,9 @@ public void OnlyIncludesWithWildcards_NotMatchingElement_ElementIsNotAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test*" });

Assert.False(filter.IsElementIncludedInReport("PrefixTest"), "Element is expected to be included.");
Assert.False(filter.IsElementIncludedInReport("prefixtest"), "Element is expected to be included.");
Assert.False(filter.IsElementIncludedInReport("PrefixTest123"), "Element is expected to be included.");
Assert.False(filter.IsElementIncludedInReport("prefixtest123"), "Element is expected to be included.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -62,6 +69,7 @@ public void IncludesAndExcludes_MatchingElement_ElementIsAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test", "-SomeExclude" });

Assert.True(filter.IsElementIncludedInReport("Test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test"), "Element is expected to be included.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -71,6 +79,7 @@ public void IncludesAndExcludes_NotMatchingElement_ElementIsNotAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test", "-Test" });

Assert.False(filter.IsElementIncludedInReport("Test"), "Element is expected to be excluded.");
Assert.False(filter.IsElementIncludedInReport("test"), "Element is expected to be excluded.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -80,7 +89,9 @@ public void IncludesAndExcludesWithWildcards_MatchingElement_ElementIsAccepted()
IFilter filter = new DefaultFilter(new[] { "+Test*", "-SomeExclude*" });

Assert.True(filter.IsElementIncludedInReport("Test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("Test123"), "Element is expected to be included.");
Assert.True(filter.IsElementIncludedInReport("test123"), "Element is expected to be included.");
Assert.True(filter.HasCustomFilters);
}

Expand All @@ -90,7 +101,9 @@ public void IncludesAndExcludesWithWildcards_NotMatchingElement_ElementIsNotAcce
IFilter filter = new DefaultFilter(new[] { "+Test*", "-Tes*" });

Assert.False(filter.IsElementIncludedInReport("Test"), "Element is expected to be included.");
Assert.False(filter.IsElementIncludedInReport("test"), "Element is expected to be included.");
Assert.False(filter.IsElementIncludedInReport("PrefixTest123"), "Element is expected to be included.");
Assert.False(filter.IsElementIncludedInReport("prefixtest123"), "Element is expected to be included.");
Assert.True(filter.HasCustomFilters);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Palmmedia.ReportGenerator.Core.Test</RootNamespace>
<AssemblyVersion>4.7.0.0</AssemblyVersion>
<FileVersion>4.7.0.0</FileVersion>
<AssemblyVersion>4.7.1.0</AssemblyVersion>
<FileVersion>4.7.1.0</FileVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/ReportGenerator.Core/Parser/Filtering/DefaultFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private static Regex CreateFilterRegex(string filter)
filter = Regex.Escape(filter);
filter = filter.Replace(@"\$\$\$\*", ".*");

return new Regex($"^{filter}$", RegexOptions.Compiled);
return new Regex($"^{filter}$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
}
}
}
4 changes: 2 additions & 2 deletions src/ReportGenerator.Core/ReportGenerator.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AssemblyName>ReportGenerator.Core</AssemblyName>
<AssemblyVersion>4.7.0.0</AssemblyVersion>
<FileVersion>4.7.0.0</FileVersion>
<AssemblyVersion>4.7.1.0</AssemblyVersion>
<FileVersion>4.7.1.0</FileVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RootNamespace>ReportGenerator.DotnetCorePluginLoader</RootNamespace>
<AssemblyVersion>4.7.0.0</AssemblyVersion>
<FileVersion>4.7.0.0</FileVersion>
<AssemblyVersion>4.7.1.0</AssemblyVersion>
<FileVersion>4.7.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<AssemblyName>ReportGenerator</AssemblyName>
<RootNamespace>Palmmedia.ReportGenerator</RootNamespace>
<StartupObject>Palmmedia.ReportGenerator.DotnetGlobalTool.Program</StartupObject>
<AssemblyVersion>4.7.0.0</AssemblyVersion>
<FileVersion>4.7.0.0</FileVersion>
<AssemblyVersion>4.7.1.0</AssemblyVersion>
<FileVersion>4.7.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/ReportGenerator.MSBuild/ReportGenerator.MSBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RootNamespace>Palmmedia.ReportGenerator.MSBuild</RootNamespace>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AssemblyVersion>4.7.0.0</AssemblyVersion>
<FileVersion>4.7.0.0</FileVersion>
<AssemblyVersion>4.7.1.0</AssemblyVersion>
<FileVersion>4.7.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- Version, adjust before build -->
<PropertyGroup>
<Version>4.7.0</Version>
<Version>4.7.1</Version>
</PropertyGroup>

<!-- Tools -->
Expand Down

0 comments on commit c3c0838

Please sign in to comment.