diff --git a/src/Microsoft.AspNet.Razor.Runtime.Precompilation/project.json b/src/Microsoft.AspNet.Razor.Runtime.Precompilation/project.json index 1d9aafcce0..915fa841f6 100644 --- a/src/Microsoft.AspNet.Razor.Runtime.Precompilation/project.json +++ b/src/Microsoft.AspNet.Razor.Runtime.Precompilation/project.json @@ -24,14 +24,14 @@ "frameworks": { "net451": { "frameworkAssemblies": { - "System.Runtime": "4.0.0.0" + "System.Runtime": "" } }, "dotnet5.4": { "dependencies": { "System.Collections.Concurrent": "4.0.11-*", "System.Linq.Expressions": "4.0.11-*", - "System.Reflection.TypeExtensions": "4.0.1-*" + "System.Reflection.TypeExtensions": "4.1.0-*" } } } diff --git a/src/Microsoft.AspNet.Razor/Chunks/Generators/ParentChunkGenerator.cs b/src/Microsoft.AspNet.Razor/Chunks/Generators/ParentChunkGenerator.cs index 54629c6260..6a03a24e10 100644 --- a/src/Microsoft.AspNet.Razor/Chunks/Generators/ParentChunkGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Chunks/Generators/ParentChunkGenerator.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Parser.SyntaxTree; namespace Microsoft.AspNet.Razor.Chunks.Generators @@ -10,10 +9,6 @@ namespace Microsoft.AspNet.Razor.Chunks.Generators { private static readonly int TypeHashCode = typeof(ParentChunkGenerator).GetHashCode(); - [SuppressMessage( - "Microsoft.Security", - "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", - Justification = "This class has no instance state")] public static readonly IParentChunkGenerator Null = new NullParentChunkGenerator(); public virtual void GenerateStartParentChunk(Block target, ChunkGeneratorContext context) diff --git a/src/Microsoft.AspNet.Razor/Chunks/Generators/SpanChunkGenerator.cs b/src/Microsoft.AspNet.Razor/Chunks/Generators/SpanChunkGenerator.cs index 225d33c8c1..c315232f7e 100644 --- a/src/Microsoft.AspNet.Razor/Chunks/Generators/SpanChunkGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Chunks/Generators/SpanChunkGenerator.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Parser.SyntaxTree; namespace Microsoft.AspNet.Razor.Chunks.Generators @@ -10,10 +9,6 @@ namespace Microsoft.AspNet.Razor.Chunks.Generators { private static readonly int TypeHashCode = typeof(SpanChunkGenerator).GetHashCode(); - [SuppressMessage( - "Microsoft.Security", - "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", - Justification = "This class has no instance state")] public static readonly ISpanChunkGenerator Null = new NullSpanChunkGenerator(); public virtual void GenerateChunk(Span target, ChunkGeneratorContext context) diff --git a/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs index 115882ec45..f236bf49a5 100644 --- a/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -15,7 +14,6 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree { private static readonly int TypeHashCode = typeof(AutoCompleteEditHandler).GetHashCode(); - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public AutoCompleteEditHandler(Func> tokenizer) : base(tokenizer) { @@ -27,7 +25,6 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree AutoCompleteAtEndOfSpan = autoCompleteAtEndOfSpan; } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public AutoCompleteEditHandler(Func> tokenizer, AcceptedCharacters accepted) : base(tokenizer, accepted) { diff --git a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs index 9ecb8d9779..9ae3dbd651 100644 --- a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs +++ b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; @@ -54,7 +53,6 @@ namespace Microsoft.AspNet.Razor.Editor _main.QueueChange(change); } - [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_main", Justification = "MainThreadState is disposed when the background thread shuts down")] public void Dispose() { _main.Cancel(); @@ -112,7 +110,6 @@ namespace Microsoft.AspNet.Razor.Editor { } - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This method is only empty in Release builds. In Debug builds it contains references to instance variables")] [Conditional("DEBUG")] protected void SetThreadId(int id) { @@ -121,7 +118,6 @@ namespace Microsoft.AspNet.Razor.Editor #endif } - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This method is only empty in Release builds. In Debug builds it contains references to instance variables")] [Conditional("DEBUG")] protected void EnsureOnThread() { @@ -131,7 +127,6 @@ namespace Microsoft.AspNet.Razor.Editor #endif } - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This method is only empty in Release builds. In Debug builds it contains references to instance variables")] [Conditional("DEBUG")] protected void EnsureNotOnThread() { @@ -148,7 +143,6 @@ namespace Microsoft.AspNet.Razor.Editor private readonly ManualResetEventSlim _hasParcel = new ManualResetEventSlim(false); private CancellationTokenSource _currentParcelCancelSource; - [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Field is used in debug code and may be used later")] private string _fileName; private readonly object _stateLock = new object(); private IList _changes = new List(); diff --git a/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs index 16deff101a..f78d0346c4 100644 --- a/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; @@ -21,7 +20,6 @@ namespace Microsoft.AspNet.Razor.Editor private readonly ISet _keywords; private readonly IReadOnlyCollection _readOnlyKeywords; - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public ImplicitExpressionEditHandler(Func> tokenizer, ISet keywords, bool acceptTrailingDot) : base(tokenizer) { @@ -181,7 +179,6 @@ namespace Microsoft.AspNet.Razor.Editor // Accepts '.' insertions in the middle of spans. Ex: '@foo.baz.bar' -> '@foo..baz.bar' // This is meant to allow intellisense when editing a span. - [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "target", Justification = "The 'target' parameter is used in Debug to validate that the function is called in the correct context.")] private static bool IsAcceptableInnerInsertion(Span target, TextChange change) { Debug.Assert(change.IsInsert); diff --git a/src/Microsoft.AspNet.Razor/Editor/SingleLineMarkupEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/SingleLineMarkupEditHandler.cs index b2b7289aeb..baf9bb72c2 100644 --- a/src/Microsoft.AspNet.Razor/Editor/SingleLineMarkupEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/SingleLineMarkupEditHandler.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -11,13 +10,11 @@ namespace Microsoft.AspNet.Razor.Editor { public class SingleLineMarkupEditHandler : SpanEditHandler { - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public SingleLineMarkupEditHandler(Func> tokenizer) : base(tokenizer) { } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public SingleLineMarkupEditHandler(Func> tokenizer, AcceptedCharacters accepted) : base(tokenizer, accepted) { diff --git a/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs index 3931c2262b..0ae29b1937 100644 --- a/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Text; @@ -16,13 +15,11 @@ namespace Microsoft.AspNet.Razor.Editor { private static readonly int TypeHashCode = typeof(SpanEditHandler).GetHashCode(); - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public SpanEditHandler(Func> tokenizer) : this(tokenizer, AcceptedCharacters.Any) { } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public SpanEditHandler(Func> tokenizer, AcceptedCharacters accepted) { AcceptedCharacters = accepted; @@ -36,7 +33,6 @@ namespace Microsoft.AspNet.Razor.Editor /// public EditorHints EditorHints { get; set; } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public Func> Tokenizer { get; set; } public static SpanEditHandler CreateDefault() @@ -44,7 +40,6 @@ namespace Microsoft.AspNet.Razor.Editor return CreateDefault(s => Enumerable.Empty()); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended delegate type and requires this level of nesting.")] public static SpanEditHandler CreateDefault(Func> tokenizer) { return new SpanEditHandler(tokenizer); @@ -133,7 +128,6 @@ namespace Microsoft.AspNet.Razor.Editor return change.IsReplace && IsAtEndOfSpan(target, change); } - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "This method should only be used on Spans")] protected internal static bool IsAtEndOfSpan(Span target, TextChange change) { return (change.OldPosition + change.OldLength) == (target.Start.AbsoluteIndex + target.Length); diff --git a/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs b/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs deleted file mode 100644 index c67d845ecb..0000000000 --- a/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -// -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click -// "In Project Suppression File". -// You do not need to add suppressions to this file manually. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "br", Scope = "resource", Target = "Microsoft.AspNet.Razor.Resources.RazorResources.resources", Justification = "Resource is referencing html tag")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Tokenizer", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Text", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Parser", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Editor", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")] diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs index 5db4ea0ec5..dc99f0f39a 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Chunks.Generators; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -214,8 +213,6 @@ namespace Microsoft.AspNet.Razor.Parser InheritsDirectiveCore(); } - [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "directive", Justification = "This only occurs in Release builds, where this method is empty by design")] - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This only occurs in Release builds, where this method is empty by design")] [Conditional("DEBUG")] protected void AssertDirective(string directive) { diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs index 8aaa6ae0f1..52e353e15b 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Chunks.Generators; using Microsoft.AspNet.Razor.Parser.SyntaxTree; @@ -101,7 +100,6 @@ namespace Microsoft.AspNet.Razor.Parser } } - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This only occurs in Release builds, where this method is empty by design")] [Conditional("DEBUG")] internal void Assert(CSharpKeyword expectedKeyword) { diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs index b22fbc277f..7234836202 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs @@ -1,10 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -153,7 +151,6 @@ namespace Microsoft.AspNet.Razor.Parser } } - [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "C# Keywords are lower-case")] public static string GetKeyword(CSharpKeyword keyword) { return keyword.ToString().ToLowerInvariant(); diff --git a/src/Microsoft.AspNet.Razor/Parser/LanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/LanguageCharacteristics.cs index f3f41ba8c7..fb2bbba8e6 100644 --- a/src/Microsoft.AspNet.Razor/Parser/LanguageCharacteristics.cs +++ b/src/Microsoft.AspNet.Razor/Parser/LanguageCharacteristics.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer; @@ -11,7 +10,6 @@ using Microsoft.AspNet.Razor.Tokenizer.Symbols; namespace Microsoft.AspNet.Razor.Parser { - [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes", Justification = "All generic type parameters are required")] public abstract class LanguageCharacteristics where TSymbolType : struct where TTokenizer : Tokenizer diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs b/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs index d08697aefa..5f37760426 100644 --- a/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs +++ b/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs @@ -4,12 +4,11 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Compilation.TagHelpers; +using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Utils; @@ -279,7 +278,6 @@ namespace Microsoft.AspNet.Razor.Parser } [Conditional("DEBUG")] - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "The method body is empty in Release builds")] internal void AssertCurrent(char expected) { Debug.Assert(CurrentCharacter == expected); diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs b/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs index 5128052382..0dcfc1cce1 100644 --- a/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs +++ b/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; @@ -27,7 +26,6 @@ namespace Microsoft.AspNet.Razor.Parser } // Returns true if the character is Whitespace and NOT a newline - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace", Justification = "This would be a breaking change in a shipping API")] public static bool IsWhitespace(char value) { return value == ' ' || @@ -37,7 +35,6 @@ namespace Microsoft.AspNet.Razor.Parser CharUnicodeInfo.GetUnicodeCategory(value) == UnicodeCategory.SpaceSeparator; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace", Justification = "This would be a breaking change in a shipping API")] public static bool IsWhitespaceOrNewLine(char value) { return IsWhitespace(value) || IsNewLine(value); diff --git a/src/Microsoft.AspNet.Razor/Parser/RazorParser.cs b/src/Microsoft.AspNet.Razor/Parser/RazorParser.cs index 03fddef087..e6e9e4b761 100644 --- a/src/Microsoft.AspNet.Razor/Parser/RazorParser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/RazorParser.cs @@ -3,15 +3,14 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNet.Razor.Compilation.TagHelpers; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.TagHelpers; using Microsoft.AspNet.Razor.Parser.TagHelpers.Internal; -using Microsoft.AspNet.Razor.Compilation.TagHelpers; using Microsoft.AspNet.Razor.Text; namespace Microsoft.AspNet.Razor.Parser @@ -142,7 +141,6 @@ namespace Microsoft.AspNet.Razor.Parser }); } - [SuppressMessage("Microsoft.Web.FxCop", "MW1200:DoNotConstructTaskInstances", Justification = "This rule is not applicable to this assembly.")] public virtual Task CreateParseTask(TextReader input, ParserVisitor consumer) { diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs index 47a0f9cd58..5498727925 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Diagnostics.CodeAnalysis; - namespace Microsoft.AspNet.Razor.Parser { public static class SyntaxConstants @@ -13,8 +11,6 @@ namespace Microsoft.AspNet.Razor.Parser public static readonly string StartCommentSequence = "@*"; public static readonly string EndCommentSequence = "*@"; - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Class is nested to provide better organization")] - [SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces", Justification = "This type name should not cause a conflict")] public static class CSharp { public static readonly int UsingKeywordLength = 5; diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/AcceptedCharacters.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/AcceptedCharacters.cs index c9488658d9..d5c8a25aef 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/AcceptedCharacters.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/AcceptedCharacters.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNet.Razor.Parser.SyntaxTree { @@ -13,13 +12,11 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree NewLine = 1, WhiteSpace = 2, - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "NonWhite", Justification = "This is not a compound word, it is two words")] NonWhiteSpace = 4, AllWhiteSpace = NewLine | WhiteSpace, Any = AllWhiteSpace | NonWhiteSpace, - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Newline", Justification = "This would be a breaking change to a previous released API")] AnyExceptNewline = NonWhiteSpace | WhiteSpace } } diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs index 27ac715df5..6fa179ced1 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using Microsoft.AspNet.Razor.Chunks.Generators; @@ -45,11 +44,6 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree Children = contents; } - [SuppressMessage( - "Microsoft.Naming", - "CA1721:PropertyNamesShouldNotMatchGetMethods", - Justification = "Type is the most appropriate name for this property and there is little chance of " + - "confusion with GetType")] public BlockType Type { get; } public IEnumerable Children { get; } diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/BlockBuilder.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/BlockBuilder.cs index 5d8696b778..852f628874 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/BlockBuilder.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/BlockBuilder.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Chunks.Generators; namespace Microsoft.AspNet.Razor.Parser.SyntaxTree @@ -21,11 +20,6 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree ChunkGenerator = original.ChunkGenerator; } - [SuppressMessage( - "Microsoft.Naming", - "CA1721:PropertyNamesShouldNotMatchGetMethods", - Justification = "Type is the most appropriate name for this property and there is little chance of " + - "confusion with GetType")] public BlockType? Type { get; set; } public IList Children { get; private set; } public IParentChunkGenerator ChunkGenerator { get; set; } diff --git a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs index 5f06f637bd..402f4a1da4 100644 --- a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs +++ b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs @@ -4,10 +4,9 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Linq; -using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Chunks.Generators; +using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -21,7 +20,6 @@ namespace Microsoft.AspNet.Razor.Parser where TSymbol : SymbolBase { // Helpers - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This only occurs in Release builds, where this method is empty by design")] [Conditional("DEBUG")] internal void Assert(TSymbolType expectedType) { @@ -280,7 +278,6 @@ namespace Microsoft.AspNet.Razor.Parser return PushSpanConfig(newConfig == null ? (Action>)null : (span, _) => newConfig(span)); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "The Action parameters are preferred over custom delegates")] protected IDisposable PushSpanConfig(Action> newConfig) { Action old = SpanConfig; @@ -294,7 +291,6 @@ namespace Microsoft.AspNet.Razor.Parser Initialize(Span); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "The Action parameters are preferred over custom delegates")] protected void ConfigureSpan(Action> config) { Action prev = SpanConfig; @@ -314,7 +310,6 @@ namespace Microsoft.AspNet.Razor.Parser Expected(Language.GetKnownSymbolType(type)); } - [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "types", Justification = "It is used in debug builds")] protected internal void Expected(params TSymbolType[] types) { Debug.Assert(!EndOfFile && CurrentSymbol != null && types.Contains(CurrentSymbol.Type)); diff --git a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.cs b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.cs index 6ffcdab753..50ccd01530 100644 --- a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.cs @@ -2,14 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; namespace Microsoft.AspNet.Razor.Parser { - [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes", Justification = "All generic type parameters are required")] public abstract partial class TokenizerBackedParser : ParserBase where TSymbolType : struct where TTokenizer : Tokenizer diff --git a/src/Microsoft.AspNet.Razor/PartialParseResult.cs b/src/Microsoft.AspNet.Razor/PartialParseResult.cs index 9523669545..7d29053e83 100644 --- a/src/Microsoft.AspNet.Razor/PartialParseResult.cs +++ b/src/Microsoft.AspNet.Razor/PartialParseResult.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNet.Razor { @@ -23,7 +22,6 @@ namespace Microsoft.AspNet.Razor /// Provisional may NOT be set with Rejected and SpanContextChanged may NOT be set with Accepted. /// [Flags] - [SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Justification = "The singular name is more appropriate here")] public enum PartialParseResult { /// diff --git a/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs b/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs index 410edd2ff7..b149d80fca 100644 --- a/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs +++ b/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Text; @@ -100,9 +99,6 @@ namespace Microsoft.AspNet.Razor } } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "This is debug only")] - [SuppressMessage("Microsoft.Web.FxCop", "MW1202:DoNotUseProblematicTaskTypes", Justification = "This rule is not applicable to this assembly.")] - [SuppressMessage("Microsoft.Web.FxCop", "MW1201:DoNotCallProblematicMethodsOnTask", Justification = "This rule is not applicable to this assembly.")] private static void RunTask(Action action) { Task.Factory.StartNew(() => diff --git a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs index cb83079f23..a4257bef83 100644 --- a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs +++ b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using Microsoft.AspNet.Razor.Editor; @@ -99,7 +98,6 @@ namespace Microsoft.AspNet.Razor get { return _currentParseTree; } } - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Since this method is heavily affected by side-effects, particularly calls to CheckForStructureChanges, it should not be made into a property")] public virtual string GetAutoCompleteString() { if (_lastAutoCompleteSpan != null) @@ -187,8 +185,6 @@ namespace Microsoft.AspNet.Razor GC.SuppressFinalize(this); } - [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_cancelTokenSource", Justification = "The cancellation token is owned by the worker thread, so it is disposed there")] - [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_changeReceived", Justification = "The change received event is owned by the worker thread, so it is disposed there")] protected virtual void Dispose(bool disposing) { if (disposing) @@ -242,7 +238,6 @@ namespace Microsoft.AspNet.Razor return result; } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are being caught here intentionally")] private void OnDocumentParseComplete(DocumentParseCompleteEventArgs args) { using (_parser.SynchronizeMainThreadState()) diff --git a/src/Microsoft.AspNet.Razor/RazorEngineHost.cs b/src/Microsoft.AspNet.Razor/RazorEngineHost.cs index 3274ff7500..d3af628ac0 100644 --- a/src/Microsoft.AspNet.Razor/RazorEngineHost.cs +++ b/src/Microsoft.AspNet.Razor/RazorEngineHost.cs @@ -3,11 +3,10 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Chunks.Generators; using Microsoft.AspNet.Razor.CodeGenerators; -using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Compilation.TagHelpers; +using Microsoft.AspNet.Razor.Parser; namespace Microsoft.AspNet.Razor { @@ -35,10 +34,6 @@ namespace Microsoft.AspNet.Razor private int _tabSize = 4; - [SuppressMessage( - "Microsoft.Usage", - "CA2214:DoNotCallOverridableMethodsInConstructors", - Justification = "The code path is safe, it is a property setter and not dependent on other state")] protected RazorEngineHost() { GeneratedClassContext = GeneratedClassContext.Default; @@ -62,7 +57,6 @@ namespace Microsoft.AspNet.Razor } } - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification = "The code path is safe, it is a property setter and not dependent on other state")] public RazorEngineHost( RazorCodeLanguage codeLanguage, Func markupParserFactory) diff --git a/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs b/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs index 91668c4d1f..e2929fc2de 100644 --- a/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs +++ b/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Security.Cryptography; using System.Text; @@ -73,10 +72,6 @@ namespace Microsoft.AspNet.Razor /// The input text to parse. /// A token used to cancel the parser. /// The resulting parse tree. - [SuppressMessage( - "Microsoft.Reliability", "CA2000:Dispose objects before losing scope", - Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + - "we don't want to dispose it")] public ParserResults ParseTemplate(ITextBuffer input, CancellationToken? cancelToken) { if (input == null) @@ -99,11 +94,6 @@ namespace Microsoft.AspNet.Razor return ParseTemplateCore(new SeekableTextReader(input), sourceFileName, cancelToken: null); } - [SuppressMessage( - "Microsoft.Reliability", - "CA2000:Dispose objects before losing scope", - Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + - "we don't want to dispose it")] public ParserResults ParseTemplate(TextReader input, CancellationToken? cancelToken) { if (input == null) @@ -202,11 +192,6 @@ namespace Microsoft.AspNet.Razor /// the Host. The default value (defined in the Host) can be used by providing null for this argument. /// /// The resulting parse tree AND generated code. - [SuppressMessage( - "Microsoft.Reliability", - "CA2000:Dispose objects before losing scope", - Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + - "we don't want to dispose it")] public GeneratorResults GenerateCode( ITextBuffer input, string className, @@ -344,11 +329,6 @@ namespace Microsoft.AspNet.Razor } } - [SuppressMessage( - "Microsoft.Reliability", - "CA2000:Dispose objects before losing scope", - Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + - "we don't want to dispose it")] public GeneratorResults GenerateCode( TextReader input, string className, diff --git a/src/Microsoft.AspNet.Razor/Text/TextExtensions.cs b/src/Microsoft.AspNet.Razor/Text/TextExtensions.cs index 5724df4751..265ae7ba3c 100644 --- a/src/Microsoft.AspNet.Razor/Text/TextExtensions.cs +++ b/src/Microsoft.AspNet.Razor/Text/TextExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Diagnostics.CodeAnalysis; using System.Text; namespace Microsoft.AspNet.Razor.Text @@ -13,7 +12,6 @@ namespace Microsoft.AspNet.Razor.Text self.Position += characters; } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The consumer is expected to dispose this object")] public static ITextDocument ToDocument(this ITextBuffer self) { var ret = self as ITextDocument; diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs index fca7684a2e..76cb0664fb 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.Extensions.Internal; @@ -35,7 +34,6 @@ namespace Microsoft.AspNet.Razor.Tokenizer.Symbols public IEnumerable Errors { get; } - [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "This is the most appropriate name for this property and conflicts are unlikely")] public TType Type { get; } public override bool Equals(object obj) diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs index f8ccaf7826..3a4a03c5ab 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Text; @@ -17,7 +16,6 @@ namespace Microsoft.AspNet.Razor.Tokenizer.Symbols return GetContent(span, e => e); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Func is the recommended type for generic delegates and requires this level of nesting")] public static LocationTagged GetContent(this SpanBuilder span, Func, IEnumerable> filter) { return GetContent(filter(span.Symbols), span.Start); diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs deleted file mode 100644 index 4cfba3241e..0000000000 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Foreach", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Foreach", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Readonly", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Readonly", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sbyte", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Sbyte", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sizeof", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Sizeof", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Stackalloc", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Stackalloc", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Typeof", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Typeof", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Uint", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Uint", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ulong", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Ulong", Justification = Justifications.SymbolTypeNames)] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ushort", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Ushort", Justification = Justifications.SymbolTypeNames)] - -internal static partial class Justifications -{ - internal const string SymbolTypeNames = "Symbol Type Names are spelled according to the language keyword or token they represent"; -} diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs index 6d72895aaa..460f17d662 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; #if DEBUG using System.Globalization; #endif @@ -19,7 +18,6 @@ namespace Microsoft.AspNet.Razor.Tokenizer where TSymbolType : struct where TSymbol : SymbolBase { - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "TextDocumentReader does not require disposal")] protected Tokenizer(ITextDocument source) { if (source == null) @@ -277,7 +275,6 @@ namespace Microsoft.AspNet.Razor.Tokenizer return true; } - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This only occurs in Release builds, where this method is empty by design")] [Conditional("DEBUG")] internal void AssertCurrent(char current) { diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs b/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs index 8c4df8bca8..830957e816 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs @@ -3,13 +3,11 @@ using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; namespace Microsoft.AspNet.Razor.Tokenizer { - [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes", Justification = "All generic parameters are required")] public class TokenizerView where TSymbolType : struct where TTokenizer : Tokenizer diff --git a/src/Microsoft.AspNet.Razor/project.json b/src/Microsoft.AspNet.Razor/project.json index c76e94708f..f9cdafd4bd 100644 --- a/src/Microsoft.AspNet.Razor/project.json +++ b/src/Microsoft.AspNet.Razor/project.json @@ -19,7 +19,6 @@ "net451": {}, "dotnet5.4": { "dependencies": { - "System.Diagnostics.Tools": "4.0.1-*", "System.IO.FileSystem": "4.0.1-*", "System.Linq": "4.0.1-*", "System.Security.Cryptography.Algorithms": "4.0.0-*",