Skip to content

Commit

Permalink
Static analysis: spelling (#26925)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers authored Dec 9, 2021
1 parent 8f7f790 commit 9b2d0dc
Show file tree
Hide file tree
Showing 31 changed files with 96 additions and 85 deletions.
12 changes: 12 additions & 0 deletions All.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,13 @@ The .NET Foundation licenses this file to you under the MIT license.
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EXml_002ECodeStyle_002EFormatSettingsUpgrade_002EXmlMoveToCommonFormatterSettingsUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=annotatable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=autoscale/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=batchable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=composability/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=composable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Constructible/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=doesnt/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=efcore/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=evaluatable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=fallbacks/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=funcletization/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -293,18 +297,26 @@ The .NET Foundation licenses this file to you under the MIT license.&#xD;
<s:Boolean x:Key="/Default/UserDictionary/Words/=materilization/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mins/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multigraph/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Namer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=navigations/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=niladic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pluralizer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Poolable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pushdown/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=remapper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=requiredness/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=retriable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reuniquify/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sargable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=savepoints/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scaffolder/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=shaper/@EntryIndexedValue">True</s:Boolean>

<s:Boolean x:Key="/Default/UserDictionary/Words/=singularized/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=spatialite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sproc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sqlite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=subqueries/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=subquery/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unconfigured/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unignore/@EntryIndexedValue">True</s:Boolean>
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Analyzers/InternalUsageDiagnosticAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ CSharpSyntax.ClassDeclarationSyntax s when s.BaseList?.Types.Count > 0
}
}

foreach (var iface in symbol.Interfaces.Where(i => IsInternal(context, i)))
foreach (var @interface in symbol.Interfaces.Where(i => IsInternal(context, i)))
{
foreach (var declaringSyntax in symbol.DeclaringSyntaxReferences)
{
Expand All @@ -205,7 +205,7 @@ CSharpSyntax.ClassDeclarationSyntax s when s.BaseList?.Types.Count > 0
{ } otherSyntax => otherSyntax.GetLocation()
};

context.ReportDiagnostic(Diagnostic.Create(_descriptor, location, iface));
context.ReportDiagnostic(Diagnostic.Create(_descriptor, location, @interface));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static StringBuilder AppendEscape(StringBuilder builder, string stringVa
{
var startingIndex = builder.Length;
return builder.Append(stringValue)
// We need this to avoid collissions with the value separator
// We need this to avoid collisions with the value separator
.Replace("|", "^|", startingIndex, builder.Length - startingIndex)
// These are invalid characters, see https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.resource.id
.Replace("/", "^2F", startingIndex, builder.Length - startingIndex)
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Design/Design/Internal/DatabaseOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public virtual SavedModelFiles ScaffoldContext(
: _rootNamespace + "." + subNamespace;
}

// if outputDir is a subfolder of projectDir, then use each subfolder as a subnamespace
// if outputDir is a subfolder of projectDir, then use each subfolder as a sub-namespace
// --output-dir $(projectFolder)/A/B/C
// => "namespace $(rootnamespace).A.B.C"
private static string? SubnamespaceFromOutputPath(string projectDir, string outputDir)
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Design/Design/Internal/DbContextOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public virtual void Optimize(string? outputDir, string? modelNamespace, string?
: _rootNamespace + "." + subNamespace;
}

// if outputDir is a subfolder of projectDir, then use each subfolder as a subnamespace
// if outputDir is a subfolder of projectDir, then use each subfolder as a sub-namespace
// --output-dir $(projectFolder)/A/B/C
// => "namespace $(rootnamespace).A.B.C"
private static string? SubnamespaceFromOutputPath(string projectDir, string outputDir)
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Design/Design/Internal/MigrationsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public virtual MigrationFiles AddMigration(
return scaffolder.Save(_projectDir, migration, outputDir);
}

// if outputDir is a subfolder of projectDir, then use each subfolder as a subnamespace
// if outputDir is a subfolder of projectDir, then use each subfolder as a sub-namespace
// --output-dir $(projectFolder)/A/B/C
// => "namespace $(rootnamespace).A.B.C"
private string? SubnamespaceFromOutputPath(string? outputDir)
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Design/Migrations/Design/ScaffoldedMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public ScaffoldedMigration(
public virtual string SnapshotName { get; }

/// <summary>
/// Gets the model snapshot's subnamespace.
/// Gets the model snapshot's sub-namespace.
/// </summary>
/// <value> The model snapshot's sub-namespace. </value>
public virtual string SnapshotSubnamespace { get; }
Expand Down
6 changes: 3 additions & 3 deletions src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,9 @@ public virtual EntityShaperExpression AddNavigationToWeakEntityType(
propertyExpression = MakeReadValueNullable(propertyExpression);

selectorExpressions.Add(propertyExpression);
var readValueExperssion = CreateReadValueExpression(propertyExpression.Type, selectorExpressions.Count - 1, property);
innerReadExpressionMap[property] = readValueExperssion;
_projectionMappingExpressions.Add(readValueExperssion);
var readValueExpression = CreateReadValueExpression(propertyExpression.Type, selectorExpressions.Count - 1, property);
innerReadExpressionMap[property] = readValueExpression;
_projectionMappingExpressions.Add(readValueExpression);
}

innerEntityProjection = new EntityProjectionExpression(innerEntityProjection.EntityType, innerReadExpressionMap);
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Metadata/ITable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface ITable : ITableBase
bool IsExcludedFromMigrations { get; }

/// <summary>
/// Gets the foreing key constraints for this table.
/// Gets the foreign key constraints for this table.
/// </summary>
IEnumerable<IForeignKeyConstraint> ForeignKeyConstraints { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Metadata/Internal/Sequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Sequence(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
[Obsolete("Use the other constructor")] // DO NOT REMOVE
// Used in snapsnot model processor. See issue#18557
// Used in snapshot model processor. See issue#18557
public Sequence(IReadOnlyModel model, string annotationName)
{
Model = model;
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Migrations/MigrationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.EntityFrameworkCore.Migrations;

/// <summary>
/// A builder providing a fluentish API for building <see cref="MigrationOperation" />s.
/// A builder providing a fluent-like API for building <see cref="MigrationOperation" />s.
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-migrations">Database migrations</see> for more information and examples.
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ protected virtual IEnumerable<IReadOnlyModificationCommand> GenerateModification
FormatTable(operation.Table, operation.Schema)));
}

var keypropertyMappings = operation.KeyColumnTypes == null
var keyPropertyMappings = operation.KeyColumnTypes == null
? GetPropertyMappings(operation.KeyColumns, operation.Table, operation.Schema, model)
: null;

Expand All @@ -981,7 +981,7 @@ protected virtual IEnumerable<IReadOnlyModificationCommand> GenerateModification
{
var name = operation.KeyColumns[j];
var value = operation.KeyValues[i, j];
var propertyMapping = keypropertyMappings?[j];
var propertyMapping = keyPropertyMappings?[j];
var columnType = operation.KeyColumnTypes?[j];
var typeMapping = propertyMapping != null
? propertyMapping.TypeMapping
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Query/CollectionResultExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CollectionResultExpression : Expression, IPrintableExpression
/// <summary>
/// Creates a new instance of the <see cref="CollectionResultExpression" /> class.
/// </summary>
/// <param name="projectionBindingExpression">An expression reprensenting how to get the subquery from SelectExpression to get the elements.</param>
/// <param name="projectionBindingExpression">An expression representing how to get the subquery from SelectExpression to get the elements.</param>
/// <param name="navigation">A navigation associated with this collection, if any.</param>
/// <param name="elementType">The clr type of individual elements in the collection.</param>
public CollectionResultExpression(
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Relational/Query/ISqlExpressionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface ISqlExpressionFactory
/// <summary>
/// Creates a new <see cref="SqlUnaryExpression" /> with the given arguments.
/// </summary>
/// <param name="operatorType">An <see cref="ExpressionType" /> reprenting SQL unary operator.</param>
/// <param name="operatorType">An <see cref="ExpressionType" /> representing SQL unary operator.</param>
/// <param name="operand">A <see cref="SqlExpression" /> to apply unary operator on.</param>
/// <param name="type">The type of the created expression.</param>
/// <param name="typeMapping">A type mapping to be assigned to the created expression.</param>
Expand All @@ -51,7 +51,7 @@ public interface ISqlExpressionFactory
/// <summary>
/// Creates a new <see cref="SqlBinaryExpression" /> with the given arguments.
/// </summary>
/// <param name="operatorType">An <see cref="ExpressionType" /> reprenting SQL unary operator.</param>
/// <param name="operatorType">An <see cref="ExpressionType" /> representing SQL unary operator.</param>
/// <param name="left">The left operand of binary operation.</param>
/// <param name="right">The right operand of binary operation.</param>
/// <param name="typeMapping">A type mapping to be assigned to the created expression.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ private Expression SimplifySqlBinary(SqlBinaryExpression sqlBinaryExpression)
if (sqlBinaryExpression.OperatorType == ExpressionType.AndAlso
|| sqlBinaryExpression.OperatorType == ExpressionType.OrElse)
{
if (TryGetInExressionCandidateInfo(left, out var leftCandidateInfo)
&& TryGetInExressionCandidateInfo(right, out var rightCandidateInfo)
if (TryGetInExpressionCandidateInfo(left, out var leftCandidateInfo)
&& TryGetInExpressionCandidateInfo(right, out var rightCandidateInfo)
&& leftCandidateInfo.ColumnExpression == rightCandidateInfo.ColumnExpression
&& leftCandidateInfo.OperationType == rightCandidateInfo.OperationType)
{
Expand Down Expand Up @@ -416,7 +416,7 @@ private static List<object> BuildListFromEnumerable(IEnumerable collection)
return result;
}

private static bool TryGetInExressionCandidateInfo(
private static bool TryGetInExpressionCandidateInfo(
SqlExpression sqlExpression,
[MaybeNullWhen(false)]
out (ColumnExpression ColumnExpression, object ConstantValue, RelationalTypeMapping TypeMapping, ExpressionType OperationType)
Expand All @@ -425,7 +425,7 @@ private static bool TryGetInExressionCandidateInfo(
if (sqlExpression is SqlUnaryExpression sqlUnaryExpression
&& sqlUnaryExpression.OperatorType == ExpressionType.Not)
{
if (TryGetInExressionCandidateInfo(sqlUnaryExpression.Operand, out var inner))
if (TryGetInExpressionCandidateInfo(sqlUnaryExpression.Operand, out var inner))
{
candidateInfo = (inner.ColumnExpression, inner.ConstantValue, inner.TypeMapping,
inner.OperationType == ExpressionType.Equal ? ExpressionType.NotEqual : ExpressionType.Equal);
Expand Down
8 changes: 4 additions & 4 deletions src/EFCore.Relational/Query/QuerySqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,15 @@ protected override Expression VisitLike(LikeExpression likeExpression)
}

/// <inheritdoc />
protected override Expression VisitCollate(CollateExpression collateExpresion)
protected override Expression VisitCollate(CollateExpression collateExpression)
{
Visit(collateExpresion.Operand);
Visit(collateExpression.Operand);

_relationalCommandBuilder
.Append(" COLLATE ")
.Append(collateExpresion.Collation);
.Append(collateExpression.Collation);

return collateExpresion;
return collateExpression;
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public override EntityShaperExpression WithEntityType(IEntityType entityType)
/// <inheritdoc />
public override EntityShaperExpression MakeNullable(bool nullable = true)
=> IsNullable != nullable
// Marking nullable requires recomputation of Discriminator condition
// Marking nullable requires re-computation of Discriminator condition
? new RelationalEntityShaperExpression(EntityType, ValueBufferExpression, true)
: this;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public LikeExpression(
public virtual SqlExpression Pattern { get; }

/// <summary>
/// The escape chater to use in LIKE.
/// The escape character to use in LIKE.
/// </summary>
public virtual SqlExpression? EscapeChar { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ public int GetHashCode([DisallowNull] (ColumnExpression Column, ValueComparer Co
=> obj.Column.GetHashCode();
}

private sealed class AliasUniquefier : ExpressionVisitor
private sealed class AliasUniquifier : ExpressionVisitor
{
private readonly HashSet<string> _usedAliases;
private readonly List<SelectExpression> _visitedSelectExpressions = new();

public AliasUniquefier(HashSet<string> usedAliases)
public AliasUniquifier(HashSet<string> usedAliases)
{
_usedAliases = usedAliases;
}
Expand Down
Loading

0 comments on commit 9b2d0dc

Please sign in to comment.