Skip to content

Commit

Permalink
also remove DoNotWarnAboutObsoleteUsageAttribute
Browse files Browse the repository at this point in the history
fixes #16
  • Loading branch information
SimonCropp committed Sep 7, 2017
1 parent 8c7beeb commit f95a26e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;
[assembly: AssemblyTitle("Obsolete")]
[assembly: AssemblyProduct("Obsolete")]
[assembly: AssemblyVersion("4.3.1")]
[assembly: AssemblyFileVersion("4.3.1")]
[assembly: AssemblyVersion("4.3.2")]
[assembly: AssemblyFileVersion("4.3.2")]
13 changes: 7 additions & 6 deletions Fody/ObsoleteAttributeWarner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ public partial class ModuleWeaver

public void CheckForNormalAttribute(IMemberDefinition memberDefinition)
{
var skip = memberDefinition
.CustomAttributes
.Any(x => x.AttributeType.Name == "DoNotWarnAboutObsoleteUsageAttribute");
if (skip)
var customAttributes = memberDefinition
.CustomAttributes;
var doNotWarnAboutObsoleteUsageAttribute = customAttributes
.FirstOrDefault(x => x.AttributeType.Name == "DoNotWarnAboutObsoleteUsageAttribute");
if (doNotWarnAboutObsoleteUsageAttribute != null)
{
customAttributes.Remove(doNotWarnAboutObsoleteUsageAttribute);
return;
}

var obsoleteExAttribute = memberDefinition
.CustomAttributes
var obsoleteExAttribute = customAttributes
.FirstOrDefault(x => x.AttributeType.Name == "ObsoleteAttribute");
if (obsoleteExAttribute == null)
{
Expand Down

0 comments on commit f95a26e

Please sign in to comment.