Skip to content

Commit

Permalink
style: Run code through dotnet format (whitespace/style)
Browse files Browse the repository at this point in the history
  • Loading branch information
hangy committed Mar 2, 2025
1 parent d6860e6 commit b3bb7ee
Show file tree
Hide file tree
Showing 52 changed files with 2,022 additions and 2,023 deletions.
2 changes: 1 addition & 1 deletion Microsoft.Security.Application.Encoder/AntiXSS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,4 @@ public static string VisualBasicScriptEncode(string input)
return Encoder.VisualBasicScriptEncode(input);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1066,4 +1066,4 @@ public void GetSafeHtmlFragment_OutOfOrderTagsShouldStillRemoveScriptsTwo()
Assert.AreEqual(expected, actual);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ public override void Reset()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public bool IsWindowsCharset
/// <summary>
/// Gets or sets the description for the character set.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="Using default get/set syntax.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Using default get/set syntax.")]
public string Description
{
get;
Expand Down Expand Up @@ -353,4 +353,4 @@ public bool TryGetEncoding(out Encoding? attemptedEncoding)
return discoveredEncoding;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public CharsetNotInstalledException(int codePage, string message) :
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public bool IsUnsafeExtendedCharacter(char ch)
{
int i = this.lastRangeIndex;

while (++ i < this.ranges.Length)
while (++i < this.ranges.Length)
{
if (ch > this.ranges[i].Last)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal class Culture
/// <summary>
/// The culture info.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification="Set in CultureCharsetDatabase.cs.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Set in CultureCharsetDatabase.cs.")]
private CultureInfo cultureInfo;

/// <summary>
Expand Down Expand Up @@ -105,7 +105,7 @@ public string Description
/// <summary>
/// Gets or sets the native description.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="Using default get/set syntax.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Using default get/set syntax.")]
public string NativeDescription
{
get;
Expand Down Expand Up @@ -164,4 +164,4 @@ internal void SetCodepageDetectionPriorityOrder(int[] newCodepageDetectionPriori
this.codepageDetectionPriorityOrder = newCodepageDetectionPriorityOrder;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ internal int MaxCharsetNameLength
/// <summary>
/// Gets or sets the name to culture map.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="Uses dictionary syntax to set value. FXCop misses this.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Uses dictionary syntax to set value. FXCop misses this.")]
internal Dictionary<string, Culture> NameToCulture
{
get
Expand All @@ -2462,7 +2462,7 @@ internal Dictionary<string, Culture> NameToCulture
/// <summary>
/// Gets or sets the ascii charset.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="Uses default get/set syntax.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Uses default get/set syntax.")]
internal Charset AsciiCharset
{
get;
Expand Down Expand Up @@ -2501,4 +2501,4 @@ public int GetHashCode(int obj)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ protected InvalidCharsetException(SerializationInfo info, StreamingContext conte
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,4 @@ public override object Clone()
return newEncoding;
}
}
}
}
32 changes: 16 additions & 16 deletions Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ public static void GetSafeHtml(TextReader sourceReader, TextWriter destinationWr
{
HtmlToHtml htmlObject = new()
{
FilterHtml = true,
OutputHtmlFragment = false,
NormalizeHtml = true
};
FilterHtml = true,
OutputHtmlFragment = false,
NormalizeHtml = true
};

Check warning on line 137 in Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs#L134-L137

Added lines #L134 - L137 were not covered by tests

htmlObject.Convert(sourceReader, destinationWriter);
}
Expand All @@ -154,10 +154,10 @@ public static void GetSafeHtml(TextReader sourceReader, Stream destinationStream
{
HtmlToHtml htmlObject = new()
{
FilterHtml = true,
OutputHtmlFragment = false,
NormalizeHtml = true
};
FilterHtml = true,
OutputHtmlFragment = false,
NormalizeHtml = true
};

Check warning on line 160 in Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs#L157-L160

Added lines #L157 - L160 were not covered by tests

htmlObject.Convert(sourceReader, destinationStream);
}
Expand All @@ -177,10 +177,10 @@ public static void GetSafeHtmlFragment(TextReader sourceReader, TextWriter desti
{
HtmlToHtml htmlObject = new()
{
FilterHtml = true,
OutputHtmlFragment = true,
NormalizeHtml = true
};
FilterHtml = true,
OutputHtmlFragment = true,
NormalizeHtml = true
};

Check warning on line 183 in Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs#L180-L183

Added lines #L180 - L183 were not covered by tests

htmlObject.Convert(sourceReader, destinationWriter);
}
Expand All @@ -200,10 +200,10 @@ public static void GetSafeHtmlFragment(TextReader sourceReader, Stream destinati
{
HtmlToHtml htmlObject = new()
{
FilterHtml = true,
OutputHtmlFragment = true,
NormalizeHtml = true
};
FilterHtml = true,
OutputHtmlFragment = true,
NormalizeHtml = true
};

Check warning on line 206 in Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/Sanitizer.cs#L203-L206

Added lines #L203 - L206 were not covered by tests

htmlObject.Convert(sourceReader, destinationStream);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ public string Value
private set;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ internal void AddArgument(string name, string value)
this.arguments.Add(new CtsConfigurationArgument(name, value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static void Assert(bool condition)
}
else
{
Debug.Assert(condition, string.Empty);
Debug.Assert(condition, string.Empty);

Check warning on line 99 in Microsoft.Security.Application.HtmlSanitization/Shared/InternalDebug.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/Shared/InternalDebug.cs#L99

Added line #L99 was not covered by tests
}
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace Microsoft.Exchange.Data.TextConverters
using System;
using System.IO;
using System.Text;
using Microsoft.Exchange.Data.Internal;
using Microsoft.Exchange.Data.Globalization;
using Microsoft.Exchange.Data.Internal;
using Strings = Microsoft.Exchange.CtsResources.TextConvertersStrings;

internal class ConverterDecodingInput : ConverterInput, IReusable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace Microsoft.Exchange.Data.TextConverters
using System;
using System.IO;
using System.Text;
using Microsoft.Exchange.Data.Internal;
using Microsoft.Exchange.Data.Globalization;
using Microsoft.Exchange.Data.Internal;

internal class ConverterEncodingOutput : ConverterOutput, IByteSource, IRestartable, IReusable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class HtmlInjection : Injection
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in method call. Not changing API at this time.")]
protected bool filterHtml;

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification="Used in method call. Not changing API at this time.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in method call. Not changing API at this time.")]
protected HtmlTagCallback callback;

protected bool injectingHead;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ internal interface IByteSource

void ReportOutput(int readCount);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ internal interface IProducerConsumer
/// </returns>
bool Flush();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ internal interface IProgressMonitor
/// </summary>
void ReportProgress();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ internal interface IRestartable
/// </summary>
void DisableRestart();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ internal interface IReusable
/// <param name="newSourceOrDestination">The new source or destination.</param>
void Initialize(object newSourceOrDestination);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ internal interface ITextSink
/// <param name="ucs32Char">The ucs32 char.</param>
void Write(int ucs32Char);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ internal interface ITextSinkEx : ITextSink
/// </summary>
void WriteNewLine();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ public void AddCharacter(char ch)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ public void TrimWhitespace()
while (this.count != 0 && ParseSupport.WhitespaceCharacter(this.buffer[this.offset]))
{
this.offset++;
this.count --;
this.count--;

Check warning on line 62 in Microsoft.Security.Application.HtmlSanitization/TextConverters/COMMON/ScratchBuffer.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/TextConverters/COMMON/ScratchBuffer.cs#L62

Added line #L62 was not covered by tests
}

if (this.count != 0)
{
int end = this.offset + this.count - 1;
while (ParseSupport.WhitespaceCharacter(this.buffer[end--]))
{
this.count --;
this.count--;

Check warning on line 70 in Microsoft.Security.Application.HtmlSanitization/TextConverters/COMMON/ScratchBuffer.cs

View check run for this annotation

Codecov / codecov/patch

Microsoft.Security.Application.HtmlSanitization/TextConverters/COMMON/ScratchBuffer.cs#L70

Added line #L70 was not covered by tests
}
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ public BufferString BufferString
get { return new BufferString(this.buffer, 0, this.count); }
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="Erroneous FXCop warning.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Erroneous FXCop warning.")]
public char this[int offset]
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ internal enum TextMapping : byte
Wingdings,
OtherSymbol
}
}
}
Loading

0 comments on commit b3bb7ee

Please sign in to comment.