Skip to content

Commit b6914d7

Browse files
authored
[StyleCleanUp] Fix spacing around keywords (SA1000) (#10602)
1 parent f30c7e3 commit b6914d7

20 files changed

+76
-78
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ dotnet_diagnostic.IDE0300.severity = suggestion
245245
# IDE1006: Naming Styles
246246
dotnet_diagnostic.IDE1006.severity = suggestion
247247

248-
# SA1000: Spacing around keywords
249-
dotnet_diagnostic.SA1000.severity = suggestion
250248
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
251249
dotnet_diagnostic.SYSLIB1045.severity = suggestion
252250

src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/XmlWrappingReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -158,7 +158,7 @@ protected override void Dispose(bool disposing)
158158
{
159159
try
160160
{
161-
if(disposing)
161+
if (disposing)
162162
{
163163
((IDisposable)_reader).Dispose();
164164
}

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/StaticExtension.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -129,7 +129,7 @@ private bool GetFieldOrPropertyValue(Type type, string name, out object value)
129129

130130
currentType = currentType.BaseType;
131131
}
132-
while(currentType is not null);
132+
while (currentType is not null);
133133

134134
currentType = type;
135135
do
@@ -143,7 +143,7 @@ private bool GetFieldOrPropertyValue(Type type, string name, out object value)
143143

144144
currentType = currentType.BaseType;
145145
}
146-
while(currentType is not null);
146+
while (currentType is not null);
147147

148148
value = null;
149149
return false;

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Context/ObjectWriterContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public ObjectWriterContext(XamlSavedContext savedContext,
3838
BaseUri = savedContext.BaseUri;
3939
// If the bottom of the stack is a (no XamlType) Value (reparse) then back-up onto it.
4040
// Otherwise add a blank frame to isolate template use from the saved context.
41-
switch(savedContext.SaveContextType)
41+
switch (savedContext.SaveContextType)
4242
{
4343
case SavedContextType.Template:
4444
// Templates always need a root namescope, to isolate them from the rest of the doc

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/XamlNodes.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public XamlNode(XamlNodeType nodeType)
6060
public XamlNode(XamlNodeType nodeType, object data)
6161
{
6262
#if DEBUG
63-
switch(nodeType)
63+
switch (nodeType)
6464
{
6565
case XamlNodeType.StartObject:
6666
Debug.Assert(data is XamlType, "XamlNode ctor, StartObject data is not a XamlType");
@@ -114,7 +114,7 @@ public XamlNode(LineInfo lineInfo)
114114
public override string ToString()
115115
{
116116
string str = string.Create(TypeConverterHelper.InvariantEnglishUS, $"{NodeType}: ");
117-
switch(NodeType)
117+
switch (NodeType)
118118
{
119119
case XamlNodeType.StartObject:
120120
str += XamlType.Name;
@@ -133,7 +133,7 @@ public override string ToString()
133133
break;
134134

135135
case XamlNodeType.None:
136-
switch(_internalNodeType)
136+
switch (_internalNodeType)
137137
{
138138
case InternalNodeType.EndOfAttributes:
139139
str += "End Of Attributes";

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/XamlObjectWriter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,12 @@ public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration)
894894
{
895895
ThrowIfDisposed();
896896
ArgumentNullException.ThrowIfNull(namespaceDeclaration);
897-
if(namespaceDeclaration.Prefix is null)
897+
if (namespaceDeclaration.Prefix is null)
898898
{
899899
throw new ArgumentException(SR.NamespaceDeclarationPrefixCannotBeNull);
900900
}
901901

902-
if(namespaceDeclaration.Namespace is null)
902+
if (namespaceDeclaration.Namespace is null)
903903
{
904904
throw new ArgumentException(SR.NamespaceDeclarationNamespaceCannotBeNull);
905905
}
@@ -2564,7 +2564,7 @@ private void ProcessNameFixup_Reparse(NameFixupToken token, bool nameResolutionI
25642564
}
25652565

25662566
#if DEBUG
2567-
if(token.Target.Property != token.TargetContext.ParentProperty)
2567+
if (token.Target.Property != token.TargetContext.ParentProperty)
25682568
{
25692569
throw new XamlInternalException("Token's Target Property '{0}' != '{1}' the Token's Context parent Property");
25702570
}

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/GenericTypeNameScanner.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void Read()
5959

6060
while (_token == GenericTypeNameScannerToken.NONE)
6161
{
62-
if(IsAtEndOfInput)
62+
if (IsAtEndOfInput)
6363
{
6464
if (_state == State.INNAME)
6565
{
@@ -197,7 +197,7 @@ private void State_Start()
197197
break;
198198

199199
default:
200-
if(XamlName.IsValidNameStartChar(CurrentChar))
200+
if (XamlName.IsValidNameStartChar(CurrentChar))
201201
{
202202
StartMultiCharToken();
203203
_state = State.INNAME;
@@ -217,14 +217,14 @@ private void State_Start()
217217

218218
private void State_InName()
219219
{
220-
if(IsAtEndOfInput || IsWhitespaceChar(CurrentChar) || CurrentChar == OpenBracket)
220+
if (IsAtEndOfInput || IsWhitespaceChar(CurrentChar) || CurrentChar == OpenBracket)
221221
{
222222
_token = GenericTypeNameScannerToken.NAME;
223223
_state = State.START;
224224
return;
225225
}
226226

227-
switch(CurrentChar)
227+
switch (CurrentChar)
228228
{
229229
case OpenParen:
230230
_pushedBackSymbol = GenericTypeNameScannerToken.OPEN;

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/MePullParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -74,7 +74,7 @@ private void SetBrokenRuleString(string ruleString)
7474

7575
private bool Expect(MeTokenType token, string ruleString)
7676
{
77-
if(_tokenizer.Token != token)
77+
if (_tokenizer.Token != token)
7878
{
7979
SetBrokenRuleString(ruleString);
8080
return false;

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/MeScanner.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -205,7 +205,7 @@ public void Read()
205205
break;
206206
}
207207

208-
if(readString)
208+
if (readString)
209209
{
210210
if (_context.CurrentType.IsMarkupExtension
211211
&& _context.CurrentBracketModeParseParameters is not null
@@ -352,12 +352,12 @@ private string ReadString()
352352
StringBuilder sb = new StringBuilder();
353353
char ch;
354354

355-
while(!IsAtEndOfInput)
355+
while (!IsAtEndOfInput)
356356
{
357357
ch = CurrentChar;
358358

359359
// handle escaping and quoting first.
360-
if(escaped)
360+
if (escaped)
361361
{
362362
sb.Append(Backslash);
363363
sb.Append(ch);

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/NodeStreamSorter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void InitializeObjectFrameStack()
4747
private void StartObjectFrame()
4848
{
4949
_startObjectDepth += 1;
50-
if(_seenStack.Count <=_startObjectDepth)
50+
if (_seenStack.Count <=_startObjectDepth)
5151
{
5252
_seenStack.Add(new SeenCtorDirectiveFlags());
5353
}
@@ -274,7 +274,7 @@ private void ReadAheadAndSortCtorProperties()
274274
// then dig in and correct the stream.
275275
//
276276
// if (HaveSeenOutOfOrderCtorDirective)
277-
if(_moveList is not null)
277+
if (_moveList is not null)
278278
{
279279
SortContentsOfReadAheadBuffer();
280280
}
@@ -613,9 +613,9 @@ private bool AdvanceToNextInstancingMember(int current, int depth, out int end)
613613
end = current;
614614
int originalIdx = _sortingInfoArray[current].OriginalOrderIndex;
615615
XamlMember nextMember = _originalNodesInOrder[originalIdx].Member;
616-
while(!IsInstancingMember(nextMember))
616+
while (!IsInstancingMember(nextMember))
617617
{
618-
if(!AdvanceTo(current, XamlNodeType.StartMember, depth, out end))
618+
if (!AdvanceTo(current, XamlNodeType.StartMember, depth, out end))
619619
{
620620
return false;
621621
}
@@ -705,7 +705,7 @@ private bool AdvanceTo(int start, XamlNodeType nodeType, int searchDepth, out in
705705
{
706706
XamlNodeType currentNodeType = _sortingInfoArray[idx].XamlNodeType;
707707
int nodeDepth = _sortingInfoArray[idx].Depth;
708-
if(nodeDepth == searchDepth)
708+
if (nodeDepth == searchDepth)
709709
{
710710
if (currentNodeType == nodeType)
711711
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/XamlAttribute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -60,7 +60,7 @@ public void Initialize(XamlParserContext context, XamlType tagType, string owner
6060
}
6161
else if (Property.IsDirective)
6262
{
63-
if(Property == XamlLanguage.Space)
63+
if (Property == XamlLanguage.Space)
6464
{
6565
Kind = ScannerAttributeKind.XmlSpace;
6666
}
@@ -79,7 +79,7 @@ public void Initialize(XamlParserContext context, XamlType tagType, string owner
7979
Kind = ScannerAttributeKind.Directive;
8080
}
8181
}
82-
else if(Property.IsAttachable)
82+
else if (Property.IsAttachable)
8383
{
8484
Kind = ScannerAttributeKind.AttachableProperty;
8585
}

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/XamlPropertyName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private XamlPropertyName(XamlName owner, string prefix, string name)
2424

2525
public static XamlPropertyName Parse(string longName)
2626
{
27-
if(string.IsNullOrEmpty(longName))
27+
if (string.IsNullOrEmpty(longName))
2828
{
2929
return null;
3030
}

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/XamlScanner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ private void PostprocessAttributes(XamlScannerNode node)
661661
// The Name attribute
662662
foreach (XamlAttribute attr in _attributes)
663663
{
664-
switch(attr.Kind)
664+
switch (attr.Kind)
665665
{
666666
case ScannerAttributeKind.Name:
667667
nameAttribute = attr;

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/RefOnly/LooseTypeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private static bool IsLooseSubClassOf(Type t1, Type t2)
136136
return false; // strictly testing for sub-class
137137
}
138138

139-
for(Type baseType = t1.BaseType; baseType is not null; baseType = baseType.BaseType)
139+
for (Type baseType = t1.BaseType; baseType is not null; baseType = baseType.BaseType)
140140
{
141141
if (AssemblyQualifiedNameEquals(baseType, t2))
142142
{

0 commit comments

Comments
 (0)