I personally got fed up with manually keeping my suppressions up to date (after 2 hours), so I wrote the following T4 template:
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Runtime.Remoting.Messaging" #>
<#@ output extension=".cs" #>
using System.Diagnostics.CodeAnalysis;
<#
var @namespace = CallContext.LogicalGetData("NamespaceHint");
var folder = Path.GetDirectoryName(Host.TemplateFile);
const int timestampLength = 15;
var timestampWildcards = new string('?', timestampLength);
var paths = Directory.EnumerateFiles(folder, timestampWildcards + "_*.cs");
const int timestampUnderscoreLength = timestampLength + 1;
var classNames = from path in paths
let fileName = Path.GetFileNameWithoutExtension(path)
where !fileName.EndsWith(".designer", StringComparison.OrdinalIgnoreCase)
where fileName.Length> timestampUnderscoreLength
select fileName.Substring(timestampUnderscoreLength);
foreach(var className in classNames)
{
var fullClassName = @namespace + "." + className;
#>
[assembly: SuppressMessage("Microsoft.Naming", "CA1701:ResourceStringCompoundWordsShouldBeCasedCorrectly", Scope = "resource", Target = "<#=fullClassName#>.resources")]
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "<#=fullClassName#>.resources")]
<#
}
#>
Create a T4 template with this content in the same folder as the migrations, the generated code will automatically contain suppressions for the resources, e.g.
[assembly: SuppressMessage("Microsoft.Naming", "CA1701:ResourceStringCompoundWordsShouldBeCasedCorrectly", Scope = "resource", Target = "LzSoftware.Collectables.Domain.EntityFramework.Migrations.InitialCreation.resources")]
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "LzSoftware.Collectables.Domain.EntityFramework.Migrations.InitialCreation.resources")]
[assembly: SuppressMessage("Microsoft.Naming", "CA1701:ResourceStringCompoundWordsShouldBeCasedCorrectly", Scope = "resource", Target = "LzSoftware.Collectables.Domain.EntityFramework.Migrations.RemovedAdministratorRoleFromSettings.resources")]
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "LzSoftware.Collectables.Domain.EntityFramework.Migrations.RemovedAdministratorRoleFromSettings.resources")]