Skip to content

Commit

Permalink
Feat: Review Spelling of Listing Code (#552)
Browse files Browse the repository at this point in the history
## Summary

Added a spell check editor config along with a exlusion.dic file that
contains the strings that we determine are spelled correctly. Then I
went through the source code and corrected the misspelled words.

Fixes 1618 from the other repo :
IntelliTect-dev/EssentialCSharp.Tooling#1618
  • Loading branch information
danOIntellitect authored Sep 21, 2023
1 parent 77f4edd commit 362874a
Show file tree
Hide file tree
Showing 47 changed files with 495 additions and 63 deletions.
368 changes: 368 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions exclusion.dic
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
valerie
ansi
specialname
awaitable
csproj
Usings
warnaserror
lpfl
cpuid
retq
vmax
decryptor
Abidal
Barthez
Coupet
Landreau
Boumsong
Chimbonda
Gallas
Givet
Sagnol
Thuram
Dhorasoo
Diarra
Makelele
Djibril Cisse
Saha
Trezeguet
Wiltord
Saha
Zaccardo
Zambrotta
Cannavaro
Oddo
Gattuso
Camoranesi
Gilardino
Iaquinta
beforefieldinit
mscorlib
Dever
Stokesbary
Heavey
enumtest
Equatable
Fireswamp
spokane
urls
iassist
Infos
IntelliTect
typelib
partnersintl
Wylam
attrs
deconstructor
Deconstructors
Hartfelt
Lindherst
Parksdale
Monteray
inigo
Machava
Uncompress
2 changes: 1 addition & 1 deletion src/Chapter01/Listing01.21.CommentingYourCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void Main()
lastName = Console.ReadLine();

/* Display a greeting to the console
using composite fomatting. */
using composite formatting. */

Console.WriteLine("Your full name is {1}, {0}.",
firstName, lastName);
Expand Down
6 changes: 3 additions & 3 deletions src/Chapter03.Tests/Table03.03.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ public async Task ParseAndCompile(string fileNameSuffix, params string[] errorId
[ExpectedException(typeof(IndexOutOfRangeException))]
public void IndexingOffTheEndOfArrayTest()
{
CommonArayCodingErrors.IndexingOffTheEndOfArray();
CommonArrayCodingErrors.IndexingOffTheEndOfArray();
}

// 7.
[TestMethod]
[ExpectedException(typeof(IndexOutOfRangeException))]
public void Hat0IsOnePastTheEndOfTheArray1Test()
{
CommonArayCodingErrors.Hat0IsOnePastTheEndOfTheArray1();
CommonArrayCodingErrors.Hat0IsOnePastTheEndOfTheArray1();
}

// 8.
[TestMethod]
[ExpectedException(typeof(IndexOutOfRangeException))]
public void Hat0IsOnePastTheEndOfTheArray2Test()
{
CommonArayCodingErrors.LastItemIsLengthMinus1();
CommonArrayCodingErrors.LastItemIsLengthMinus1();
}
}
4 changes: 2 additions & 2 deletions src/Chapter03/Table03.01.TupleDeclarationAndAssignment.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_01;

public class TupleDeclarationAndAssigment
public class TupleDeclarationAndAssignment
{
// 1.
public void AssignTupleToIndividuallyDeclaredVaraibles()
public void AssignTupleToIndividuallyDeclaredVariables()
{
(string country, string capital, double gdpPerCapita) =
("Burundi", "Bujumbura", 263.67);
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.a.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 1.
static public void SquareBracketsOnVariableRatherThanType()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.c.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 3.
static public void ArraySizeCannotBeSpecifiedInDataType()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.d.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 4.
static public void ArraySizeOrInitializerIsRequired()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.e.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 5.
static public void ArraySizeWithEmptyInitializer()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.f.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 6.
static public void IndexingOffTheEndOfArray()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.g.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 7.
static public void Hat0IsOnePastTheEndOfTheArray1()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.h.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 8.
static public void LastItemIsLengthMinus1()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.i.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 9.
static public void MultiDimensionalArrayWithInconsistentSize()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter03/Table03.03.j.CommonArrayCodingErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03;

public partial class CommonArayCodingErrors
public partial class CommonArrayCodingErrors
{
// 10.
static public void MembersInJaggedArraysMustBeInstantiated()
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter06/Listing06.03.InstantiatingAClass.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Justificaiton: only partial implementation provided for elucidation.
// Justification: only partial implementation provided for elucidation.
#pragma warning disable IDE0060 // Remove unused parameter

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_03;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#pragma warning disable CS8618
// Our Main doesn't leverage everything in our Employee implementation - in production it would
#pragma warning disable CS0649
// Disabled pending introductin to object initializers
// Disabled pending introduction to object initializers
#pragma warning disable IDE0017
// Add readonly modifier ignored pending introduction of the concept
#pragma warning disable IDE0044
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter06/Listing06.17.DefiningProperties.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Non-nullable field is uninitialized. Consider declaring as nullable.
#pragma warning disable CS8618
// Disabled pending introductin to object initializers
// Disabled pending introduction to object initializers
#pragma warning disable IDE0017

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_17;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Non-nullable field is uninitialized. Consider declaring as nullable.
#pragma warning disable CS8618
// Disabled pending introductin to object initializers
// Disabled pending introduction to object initializers
#pragma warning disable IDE0017

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_18;
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Non-nullable field is uninitialized. Consider declaring as nullable.
#pragma warning disable CS8618 // Pending a constructors
// Disabled pending introductin to object initializers
// Disabled pending introduction to object initializers
#pragma warning disable IDE0017

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_22;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter07.Listing07_23;
#region INCLUDE
using System.Diagnostics.CodeAnalysis;

public static class SolisticeHelper
public static class SolsticeHelper
{
public static bool IsSolstice(
DateTime date)
Expand All @@ -30,8 +30,8 @@ public static bool TryGetSolstice(DateTime date,
{
if ((solstice = date.Month switch
{
12 => "Winter Solistice",
6 => "Summer Solistice",
12 => "Winter Solstice",
6 => "Summer Solstice",
_ => null
}) is not null) return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter07/Listing07.25.LogicalPatternExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static bool TryGetPhoneButton(
{
'1' => '1',
'2' or >= 'a' and <= 'c' => '2',
// not operator and parethesis example (C# 10)
// not operator and parenthesis example (C# 10)
'3' or not (< 'd' or > 'f') => '3',
'4' or >= 'g' and <= 'i' => '4',
'5' or >= 'j' and <= 'l' => '5',
Expand Down
4 changes: 2 additions & 2 deletions src/Chapter07/Listing07.26.ParenthesizedPatternExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class PeriodsOfTheDay
public bool IsOutsideOfStandardWorkHours(
TimeOnly time) =>
time.Hour is not
(> 8 and < 17 and not 12); // Parentbhesis Pattern - C# 10.
(> 8 and < 17 and not 12); // Parenthesis Pattern - C# 10.
#endregion INCLUDE

static bool TryGetPhoneButton(
Expand All @@ -19,7 +19,7 @@ static bool TryGetPhoneButton(
{
'1' => '1',
'2' or >= 'a' and <= 'c' => '2',
// not operator and parethesis example (C# 10)
// not operator and parenthesis example (C# 10)
'3' or not (< 'd' or > 'f') => '3',
'4' or >= 'g' and <= 'i' => '4',
'5' or >= 'j' and <= 'l' => '5',
Expand Down
4 changes: 2 additions & 2 deletions src/Chapter07/Listing07.31.SwitchWithPatternMatching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class Program
{
#region INCLUDE
public static string? CompositeFormatDate(
object input, string compositFormatString) =>
object input, string compositeFormatString) =>
input switch
{
DateTime
Expand All @@ -24,7 +24,7 @@ public class Program
((int Year, int Month, int Day)?) null,
_ => null
} is (int, int, int) date ? string.Format(
compositFormatString, date.Year, date.Month, date.Day) : null;
compositeFormatString, date.Year, date.Month, date.Day) : null;
#endregion INCLUDE
}
file static class DateDeconstructors
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter07/Listing07.32.RecursivePatternMatching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void Main()
(inigo, buttercup);

if (couple is
( // Tuple: Retrived from deconstructor of Person
( // Tuple: Retrieved from deconstructor of Person
( // Positional: Select left side or tuple
{ // Property of firstName
Length: int inigoFirstNameLength
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Justification: Only a aartial implmentation provided for elucidation purposes.
// Justification: Only a partial implementation provided for elucidation purposes.
#pragma warning disable IDE0059 // Unnecessary assignment of a value

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter08.Listing08_04;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ private static int[] DisplayHeaders(string[] headers)
private static void DisplayItemRow(
int[] columnWidths, IListable item)
{
string?[] columValues = item.CellValues;
if (columnWidths.Length != columValues.Length)
string?[] columnValues = item.CellValues;
if (columnWidths.Length != columnValues.Length)
{
throw new ArgumentOutOfRangeException(
$"{ nameof(columnWidths) },{ nameof(item) }.{nameof(item.CellColors) }",
Expand All @@ -251,9 +251,9 @@ private static void DisplayItemRow(
// Exception handling excluded for elucidation
ConsoleColor originalColor = Console.ForegroundColor;
ConsoleColor[] itemColors = ((IListable)item).CellColors;
for (int index = 0; index < columValues.Length; index++)
for (int index = 0; index < columnValues.Length; index++)
{
string itemToPrint = (columValues[index] ?? "").PadRight(columnWidths[index], ' ');
string itemToPrint = (columnValues[index] ?? "").PadRight(columnWidths[index], ' ');
Console.ForegroundColor = itemColors[index];
Console.Write(itemToPrint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static void Run()
// implemented in the class.
// ((IWorkflowActivity)this).InternalRun();
// activity.RedirectStandardInOut();
// activity.ExecuteProcss();
// activity.ExecuteProcess();
Console.WriteLine(
@$"Executing non-polymorphic Run() with process '{
activity.ExecutableName}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace ProtectedAccessModifiers
}

// 5.
namespace ProvateAccessModifiers
namespace PrivateAccessModifiers
{
public interface IPerson
{
Expand Down Expand Up @@ -158,7 +158,7 @@ private protected string GetName() =>
}
public interface IEmployee: IPerson
{
int EmpoyeeId => GetName().GetHashCode();
int EmployeeId => GetName().GetHashCode();
}
public class Person : IPerson
{
Expand Down
2 changes: 1 addition & 1 deletion src/Chapter10/Listing10.02.AddingAnOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Coordinate(Longitude longitude, Latitude latitude)
{

// There is no need to check of null in this
// case because Coordinate is a valye type.
// case because Coordinate is a value type.
return (leftHandSide.Equals(rightHandSide));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Coordinate(Longitude longitude, Latitude latitude)
{

// There is no need to check of null in this
// case because Coordinate is a valye type.
// case because Coordinate is a value type.
return (leftHandSide.Equals(rightHandSide));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Justification: Only showing partial implementaiton.
// Justification: Only showing partial implementation.
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_13;
Expand All @@ -11,7 +11,7 @@ public Pair(T first)
{
First = first;
#region EXCLUDE
// Justifiction: Ignore warning pending struct/class constraints, later on in the chapter,
// Justification: Ignore warning pending struct/class constraints, later on in the chapter,
// so that Second can be declared as T?.
#pragma warning disable CS8601 // Possible null reference assignment.
#endregion EXCLUDE
Expand Down
Loading

0 comments on commit 362874a

Please sign in to comment.