Skip to content

Commit 5363688

Browse files
authored
[StyleCleanUp] Addressing SA warnings (#10123)
* Update: Resolve SA1206 in src * Update: Resolve SA1513 in src * Update: Resolve SA1518 in src * Update: Resolve SA1508 in src * Update: Resolve SA1507 in src * Update: Resolve SA1505 in src * Update: Resolve SA1500 in src
1 parent 54ee964 commit 5363688

File tree

87 files changed

+1370
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1370
-160
lines changed

src/Microsoft.DotNet.Wpf/src/.editorconfig

-21
Original file line numberDiff line numberDiff line change
@@ -311,30 +311,9 @@ dotnet_diagnostic.SA1121.severity = suggestion
311311
# SA1129: Do not use default value type constructor
312312
dotnet_diagnostic.SA1129.severity = suggestion
313313

314-
# SA1206: Keyword ordering
315-
dotnet_diagnostic.SA1206.severity = suggestion
316-
317314
# SA1400: Member should declare an access modifier
318315
dotnet_diagnostic.SA1400.severity = suggestion
319316

320-
# SA1500: Braces for multi-line statements should not share line
321-
dotnet_diagnostic.SA1500.severity = suggestion
322-
323-
# SA1505: An opening brace should not be followed by a blank line
324-
dotnet_diagnostic.SA1505.severity = suggestion
325-
326-
# SA1507: Code should not contain multiple blank lines in a row
327-
dotnet_diagnostic.SA1507.severity = suggestion
328-
329-
# SA1508: A closing brace should not be preceded by a blank line
330-
dotnet_diagnostic.SA1508.severity = suggestion
331-
332-
# SA1513: Closing brace should be followed by blank line
333-
dotnet_diagnostic.SA1513.severity = suggestion
334-
335-
# SA1518: Code should not contain blank lines at the end of the file
336-
dotnet_diagnostic.SA1518.severity = suggestion
337-
338317
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
339318
dotnet_diagnostic.SYSLIB1045.severity = suggestion
340319

src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/SafeSecurityHelper.cs

+9
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ internal static Assembly GetLoadedAssembly(AssemblyName assemblyName)
151151
return assemblies[i];
152152
}
153153
}
154+
154155
return null;
155156
}
156157

@@ -171,6 +172,7 @@ static AssemblyName GetAssemblyName(Assembly assembly)
171172
return result;
172173
}
173174
}
175+
174176
//
175177
// We use AssemblyName ctor here because GetName demands FileIOPermission
176178
// and does load more than just the required information.
@@ -185,6 +187,7 @@ static AssemblyName GetAssemblyName(Assembly assembly)
185187
GCNotificationToken.RegisterCallback(_cleanupCollectedAssemblies, null);
186188
_isGCCallbackPending = true;
187189
}
190+
188191
return result;
189192
}
190193
}
@@ -203,6 +206,7 @@ static void CleanupCollectedAssemblies(object state) // dummy parameter required
203206
{
204207
continue;
205208
}
209+
206210
if (weakRef.IsAlive)
207211
{
208212
// There is a weak ref that is still alive, register another GC callback for next time
@@ -215,16 +219,19 @@ static void CleanupCollectedAssemblies(object state) // dummy parameter required
215219
{
216220
keysToRemove = new List<object>();
217221
}
222+
218223
keysToRemove.Add(key);
219224
}
220225
}
226+
221227
if (keysToRemove is not null)
222228
{
223229
foreach (object key in keysToRemove)
224230
{
225231
_assemblies.Remove(key);
226232
}
227233
}
234+
228235
if (foundLiveDynamicAssemblies)
229236
{
230237
GCNotificationToken.RegisterCallback(_cleanupCollectedAssemblies, null);
@@ -311,6 +318,7 @@ public override bool Equals(object o)
311318
return (target1 == target2);
312319
}
313320
}
321+
314322
return base.Equals(o);
315323
}
316324

@@ -320,6 +328,7 @@ public override bool Equals(object o)
320328
{
321329
return object.ReferenceEquals(right, null);
322330
}
331+
323332
return left.Equals(right);
324333
}
325334

src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Xaml/Context/XamlContextStack.cs

+4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ public XamlContextStack(XamlContextStack<T> source, bool copy)
4747
{
4848
_currentFrame = newFrame;
4949
}
50+
5051
if (lastFrameInNewStack is not null)
5152
{
5253
lastFrameInNewStack.Previous = newFrame;
5354
}
55+
5456
lastFrameInNewStack = newFrame;
5557
iteratorFrame = (T)iteratorFrame.Previous;
5658
}
@@ -88,6 +90,7 @@ public T GetFrame(int depth)
8890
{
8991
iteratorFrame = (T)iteratorFrame.Previous;
9092
}
93+
9194
return iteratorFrame;
9295
}
9396

@@ -106,6 +109,7 @@ public void PushScope()
106109
_recycledFrame = (T)_recycledFrame.Previous;
107110
_currentFrame.Previous = lastFrame;
108111
}
112+
109113
_depth++;
110114
Debug.Assert(CurrentFrame.Depth == Depth);
111115
}

src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Xaml/Parser/SpecialBracketCharacters.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class SpecialBracketCharacters : ISupportInitialize
2121
{
2222
private string _startChars;
2323
private string _endChars;
24-
private readonly static ISet<char> _restrictedCharSet = new SortedSet<char>((new char[] { '=', ',', '\'', '"', '{', '}', '\\' }));
24+
private static readonly ISet<char> _restrictedCharSet = new SortedSet<char>((new char[] { '=', ',', '\'', '"', '{', '}', '\\' }));
2525
private bool _initializing;
2626
private StringBuilder _startCharactersStringBuilder;
2727
private StringBuilder _endCharactersStringBuilder;

0 commit comments

Comments
 (0)