Skip to content

Commit 6a46d37

Browse files
committed
2 parents 0b87ad6 + 23baefe commit 6a46d37

30 files changed

+82
-15
lines changed

source/Unity.Configuration/Src/SectionExtensionContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public abstract class SectionExtensionContext
2828
/// </summary>
2929
/// <typeparam name="TAliased">Type the alias maps to.</typeparam>
3030
/// <param name="alias">The alias to use</param>
31-
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
31+
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
3232
public void AddAlias<TAliased>(string alias)
3333
{
3434
AddAlias(alias, typeof (TAliased));
@@ -46,7 +46,7 @@ public void AddAlias<TAliased>(string alias)
4646
/// </summary>
4747
/// <typeparam name="TElement">Type the tag maps to.</typeparam>
4848
/// <param name="tag">Tag name in the XML.</param>
49-
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
49+
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
5050
public void AddElement<TElement>(string tag)
5151
where TElement : DeserializableConfigurationElement
5252
{

source/Unity.Interception/Src/ContainerIntegration/Interception.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public Interception SetInterceptorFor(Type typeToIntercept, ITypeInterceptor int
8282
/// <param name="name">Name type is registered under.</param>
8383
/// <param name="interceptor">Interceptor object to use.</param>
8484
/// <returns>This extension object.</returns>
85+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
8586
public Interception SetInterceptorFor<T>(string name, ITypeInterceptor interceptor)
8687
{
8788
return SetInterceptorFor(typeof(T), name, interceptor);
@@ -93,6 +94,7 @@ public Interception SetInterceptorFor<T>(string name, ITypeInterceptor intercept
9394
/// <typeparam name="T">Type to intercept</typeparam>
9495
/// <param name="interceptor">Interceptor object to use.</param>
9596
/// <returns>This extension object.</returns>
97+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
9698
public Interception SetInterceptorFor<T>(ITypeInterceptor interceptor)
9799
{
98100
return SetInterceptorFor(typeof(T), null, interceptor);
@@ -152,6 +154,7 @@ public Interception SetDefaultInterceptorFor(Type typeToIntercept, ITypeIntercep
152154
/// <typeparam name="TTypeToIntercept">Type to intercept</typeparam>
153155
/// <param name="interceptor">Interceptor instance.</param>
154156
/// <returns>This extension object.</returns>
157+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
155158
public Interception SetDefaultInterceptorFor<TTypeToIntercept>(ITypeInterceptor interceptor)
156159
{
157160
return SetDefaultInterceptorFor(typeof(TTypeToIntercept), interceptor);
@@ -175,6 +178,7 @@ public Interception SetInterceptorFor(Type typeToIntercept, IInstanceInterceptor
175178
/// <param name="name">Name type is registered under.</param>
176179
/// <param name="interceptor">Instance interceptor to use.</param>
177180
/// <returns>This extension object.</returns>
181+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
178182
public Interception SetInterceptorFor<T>(string name, IInstanceInterceptor interceptor)
179183
{
180184
return SetInterceptorFor(typeof(T), name, interceptor);
@@ -186,6 +190,7 @@ public Interception SetInterceptorFor<T>(string name, IInstanceInterceptor inter
186190
/// <typeparam name="T">Type to intercept.</typeparam>
187191
/// <param name="interceptor">Instance interceptor to use.</param>
188192
/// <returns>This extension object.</returns>
193+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
189194
public Interception SetInterceptorFor<T>(IInstanceInterceptor interceptor)
190195
{
191196
return SetInterceptorFor(typeof(T), null, interceptor);
@@ -219,6 +224,7 @@ public Interception SetDefaultInterceptorFor(Type typeToIntercept, IInstanceInte
219224
/// <typeparam name="TTypeToIntercept">Type the interception is being configured for.</typeparam>
220225
/// <param name="interceptor">The interceptor to use by default.</param>
221226
/// <returns>This extension object.</returns>
227+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
222228
public Interception SetDefaultInterceptorFor<TTypeToIntercept>(IInstanceInterceptor interceptor)
223229
{
224230
return SetDefaultInterceptorFor(typeof(TTypeToIntercept), interceptor);

source/Unity.Interception/Src/ContainerIntegration/PolicyDefinition.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ public PolicyDefinition AddMatchingRule(
211211
/// <returns>
212212
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
213213
/// </returns>
214+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
214215
public PolicyDefinition AddMatchingRule<TMatchingRule>(
215216
params InjectionMember[] injectionMembers)
216217
where TMatchingRule : IMatchingRule
@@ -233,6 +234,7 @@ public PolicyDefinition AddMatchingRule<TMatchingRule>(
233234
/// <returns>
234235
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
235236
/// </returns>
237+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
236238
public PolicyDefinition AddMatchingRule<TMatchingRule>(
237239
LifetimeManager lifetimeManager,
238240
params InjectionMember[] injectionMembers)
@@ -255,6 +257,7 @@ public PolicyDefinition AddMatchingRule<TMatchingRule>(
255257
/// <returns>
256258
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
257259
/// </returns>
260+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
258261
public PolicyDefinition AddMatchingRule<TMatchingRule>(
259262
string name,
260263
params InjectionMember[] injectionMembers)
@@ -280,6 +283,7 @@ public PolicyDefinition AddMatchingRule<TMatchingRule>(
280283
/// <returns>
281284
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
282285
/// </returns>
286+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
283287
public PolicyDefinition AddMatchingRule<TMatchingRule>(
284288
string name,
285289
LifetimeManager lifetimeManager,
@@ -425,6 +429,7 @@ public PolicyDefinition AddCallHandler(
425429
/// <returns>
426430
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
427431
/// </returns>
432+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
428433
public PolicyDefinition AddCallHandler<TCallHandler>(
429434
params InjectionMember[] injectionMembers)
430435
where TCallHandler : ICallHandler
@@ -447,6 +452,7 @@ public PolicyDefinition AddCallHandler<TCallHandler>(
447452
/// <returns>
448453
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
449454
/// </returns>
455+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
450456
public PolicyDefinition AddCallHandler<TCallHandler>(
451457
LifetimeManager lifetimeManager,
452458
params InjectionMember[] injectionMembers)
@@ -469,6 +475,7 @@ public PolicyDefinition AddCallHandler<TCallHandler>(
469475
/// <returns>
470476
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
471477
/// </returns>
478+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
472479
public PolicyDefinition AddCallHandler<TCallHandler>(
473480
string name,
474481
params InjectionMember[] injectionMembers)
@@ -494,6 +501,7 @@ public PolicyDefinition AddCallHandler<TCallHandler>(
494501
/// <returns>
495502
/// The <see cref="PolicyDefinition"/> than allows further configuration of the policy.
496503
/// </returns>
504+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "As designed")]
497505
public PolicyDefinition AddCallHandler<TCallHandler>(
498506
string name,
499507
LifetimeManager lifetimeManager,

source/Unity.Interception/Src/Interceptors/TypeInterceptors/VirtualMethodInterception/VirtualMethodInterceptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public IEnumerable<MethodImplementationInfo> GetInterceptableMethods(Type interc
5151
{
5252
Guard.ArgumentNotNull(implementationType, "implementationType");
5353

54-
return DoGetInterceptableMethods(interceptedType, implementationType);
54+
return DoGetInterceptableMethods(implementationType);
5555
}
5656

57-
private IEnumerable<MethodImplementationInfo> DoGetInterceptableMethods(Type interceptedType, Type implementationType)
57+
private IEnumerable<MethodImplementationInfo> DoGetInterceptableMethods(Type implementationType)
5858
{
5959
var interceptableMethodsToInterfaceMap = new Dictionary<MethodInfo, MethodInfo>();
6060

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
2+
3+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mvc", Justification = "Consistent with MVC spelling")]
4+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mvc", Scope = "namespace", Target = "Microsoft.Practices.Unity.Mvc", Justification = "Consistent with MVC spelling")]
5+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Practices.Unity.Mvc", Justification = "Reviewed")]
6+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Practices.Unity", Justification = "Reviewed")]

source/Unity.Mvc/Src/Unity.Mvc.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<Reference Include="System.Xml" />
7575
</ItemGroup>
7676
<ItemGroup>
77+
<Compile Include="GlobalSuppressions.cs" />
7778
<Compile Include="PerRequestLifetimeManager.cs" />
7879
<Compile Include="Properties\AssemblyInfo.cs" />
7980
<Compile Include="Properties\Resources.Designer.cs">

source/Unity.Mvc/Src/UnityPerRequestHttpModule.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
using System;
44
using System.Collections.Generic;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Linq;
67
using System.Web;
78
using Microsoft.Practices.Unity.Mvc.Properties;
9+
using Microsoft.Practices.Unity.Utility;
810

911
namespace Microsoft.Practices.Unity.Mvc
1012
{
@@ -60,8 +62,10 @@ public void Dispose()
6062
/// </summary>
6163
/// <param name="context">An <see cref="HttpApplication"/> that provides access to the methods, properties,
6264
/// and events common to all application objects within an ASP.NET application.</param>
65+
[SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated with Guard class")]
6366
public void Init(HttpApplication context)
6467
{
68+
Guard.ArgumentNotNull(context, "context");
6569
context.EndRequest += OnEndRequest;
6670
}
6771

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
2+
3+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Api", Justification = "Consistent with WebApi spelling")]
4+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Api", Scope = "namespace", Target = "Microsoft.Practices.Unity.WebApi", Justification = "Consistent with WebApi spelling")]

source/Unity.WebApi/Src/Unity.WebApi.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<Reference Include="System.Xml" />
5757
</ItemGroup>
5858
<ItemGroup>
59+
<Compile Include="GlobalSuppressions.cs" />
5960
<Compile Include="UnityHierarchicalDependencyResolver.cs" />
6061
<Compile Include="Properties\AssemblyInfo.cs" />
6162
<Compile Include="UnityDependencyResolver.cs" />

source/Unity.ruleset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RuleSet Name="Unity" ToolsVersion="11.0">
3+
<Include Path="extendeddesignguidelinerules.ruleset" Action="Default" />
34
<Include Path="globalizationrules.ruleset" Action="Default" />
45
<Include Path="minimumrecommendedrules.ruleset" Action="Default" />
56
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">

0 commit comments

Comments
 (0)