Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyAkinshin committed Jul 15, 2018
1 parent a7426e8 commit c724e94
Show file tree
Hide file tree
Showing 60 changed files with 187 additions and 187 deletions.
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Attributes/ArgumentsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ArgumentsAttribute : Attribute
{
public object[] Values { get; private set; }

// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
public ArgumentsAttribute()
{
Values = Array.Empty<object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class BenchmarkCategoryAttribute : Attribute
{
public string[] Categories { get; }

// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected BenchmarkCategoryAttribute() { }

public BenchmarkCategoryAttribute(params string[] categories)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public abstract class ColumnConfigBaseAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected ColumnConfigBaseAttribute()
{
Config = ManualConfig.CreateEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public class ExporterConfigBaseAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected ExporterConfigBaseAttribute()
{
Config = ManualConfig.CreateEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace BenchmarkDotNet.Attributes
{
public class AllCategoriesFilterAttribute : FilterConfigBaseAttribute
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
public AllCategoriesFilterAttribute() { }

public AllCategoriesFilterAttribute(params string[] targetCategories) : base(new AllCategoriesFilter(targetCategories)) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace BenchmarkDotNet.Attributes
{
public class AnyCategoriesFilterAttribute : FilterConfigBaseAttribute
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
public AnyCategoriesFilterAttribute() { }

public AnyCategoriesFilterAttribute(params string[] targetCategories) : base(new AnyCategoriesFilter(targetCategories)) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public abstract class FilterConfigBaseAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected FilterConfigBaseAttribute()
{
Config = ManualConfig.CreateEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class GenericTypeArgumentsAttribute : Attribute
{
public Type[] GenericTypeArguments { get; }

// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
public GenericTypeArgumentsAttribute() => GenericTypeArguments = Array.Empty<Type>();

public GenericTypeArgumentsAttribute(params Type[] genericTypeArguments) => GenericTypeArguments = genericTypeArguments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GroupBenchmarksByAttribute: Attribute, IConfigSource
{
public IConfig Config { get; }

// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected GroupBenchmarksByAttribute()
{
Config = ManualConfig.CreateEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public class HardwareCountersAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected HardwareCountersAttribute()
{
Config = ManualConfig.CreateEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public class JobConfigBaseAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor which use only CLS-compliant types
// CLS-Compliant Code requires a constructor which use only CLS-compliant types
public JobConfigBaseAttribute() => Config = ManualConfig.CreateEmpty();

public JobConfigBaseAttribute(Job job) => Config = ManualConfig.CreateEmpty().With(job);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] // users must not be able to define given mutator attribute more than once per type
public class JobMutatorConfigBaseAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor which use only CLS-compliant types
// CLS-Compliant Code requires a constructor which use only CLS-compliant types
public JobMutatorConfigBaseAttribute() => Config = ManualConfig.CreateEmpty();

protected JobMutatorConfigBaseAttribute(Job job) => Config = ManualConfig.CreateEmpty().With(job.AsMutator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace BenchmarkDotNet.Attributes
/// </summary>
public class MinIterationTimeAttribute : JobMutatorConfigBaseAttribute
{
public MinIterationTimeAttribute(double miliseconds) : base(Job.Default.WithMinIterationTime(TimeInterval.FromMilliseconds(miliseconds)))
public MinIterationTimeAttribute(double milliseconds) : base(Job.Default.WithMinIterationTime(TimeInterval.FromMilliseconds(milliseconds)))
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Attributes/ParamsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ParamsAttribute : Attribute
{
public object[] Values { get; private set; }

// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
public ParamsAttribute()
{
Values = Array.Empty<object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BenchmarkDotNet.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public abstract class ValidatorConfigBaseAttribute : Attribute, IConfigSource
{
// CLS-Compliant Code requires a constuctor without an array in the argument list
// CLS-Compliant Code requires a constructor without an array in the argument list
protected ValidatorConfigBaseAttribute()
{
Config = ManualConfig.CreateEmpty();
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Code/ArrayParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public string ToSourceCode()
/// for types where calling .ToString() will be NOT enough to re-create them in auto-generated source code file
/// </summary>
/// <param name="array">the array</param>
/// <param name="toSourceCode">method which tranforms an item of type T to it's C# representation
/// <param name="toSourceCode">method which transforms an item of type T to it's C# representation
/// example: point => $"new Point2d({point.X}, {point.Y})"
/// </param>
public static ArrayParam<T> ForComplexTypes(T[] array, Func<T, string> toSourceCode) => new ArrayParam<T>(array, toSourceCode);
Expand Down
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class ConfigParser
{ "stackoverflow", new[] { MarkdownExporter.StackOverflow } },
{ "github", new[] { MarkdownExporter.GitHub } },
{ "plain", new[] { PlainExporter.Default } },
{ "rplot", new[] { CsvMeasurementsExporter.Default, RPlotExporter.Default } }, // R Plots depends on having the full measurments available
{ "rplot", new[] { CsvMeasurementsExporter.Default, RPlotExporter.Default } }, // R Plots depends on having the full measurements available
{ "json", new[] { JsonExporter.Default } },
{ "briefjson", new[] { JsonExporter.Brief } },
{ "fulljson", new[] { JsonExporter.Full } },
Expand Down Expand Up @@ -119,7 +119,7 @@ private static ReadOnlyConfig CreateConfig(CommandLineOptions options)

config.Add(Expand(GetBaseJob(options), options).ToArray());

config.Add(options.Exporters.SelectMany(exporer => AvailableExporters[exporer]).ToArray());
config.Add(options.Exporters.SelectMany(exporter => AvailableExporters[exporter]).ToArray());

if (options.UseMemoryDiagnoser)
config.Add(MemoryDiagnoser.Default);
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Diagnosers/MonoDisassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal DisassemblyResult Disassemble(BenchmarkCase benchmarkCase, MonoRuntime
string monoPath = mono?.CustomPath ?? "mono";
string arguments = $"--compile {fqnMethod} {llvmFlag} {exePath}";

var output = ProcessHelper.RunAndReadOutputLineByLine(monoPath, arguments, environmentVariables, includeErros: true);
var output = ProcessHelper.RunAndReadOutputLineByLine(monoPath, arguments, environmentVariables, includeErrors: true);
string commandLine = $"{GetEnvironmentVariables(environmentVariables)} {monoPath} {arguments}";

return OutputParser.Parse(output, benchmarkTarget.WorkloadMethod.Name, commandLine);
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Diagnosers/WindowsDisassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private string GetDisassemblerPath(string architectureName)

private void CopyAllRequiredDependencies(Assembly assemblyWithDisassemblersInResources, string destinationFolder)
{
// ClrMD and Cecil are also embeded in the resources, we need to copy them as well
// ClrMD and Cecil are also embedded in the resources, we need to copy them as well
foreach (var dependency in assemblyWithDisassemblersInResources.GetManifestResourceNames().Where(name => name.EndsWith(".dll")))
{
// dependency is sth like "BenchmarkDotNet.Disassemblers.net46.win7_x64.Microsoft.Diagnostics.Runtime.dll"
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace BenchmarkDotNet.Environments
{
// this class is used by our auto-generated benchmark program,
// keep it in mind if you want to do some renaming
// you can finde the source code at Templates\BenchmarkProgram.txt
// you can find the source code at Templates\BenchmarkProgram.txt
public class HostEnvironmentInfo : BenchmarkEnvironmentInfo
{
public const string BenchmarkDotNetCaption = "BenchmarkDotNet";
Expand Down
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/Exporters/ExporterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class ExporterBase : IExporter
public IEnumerable<string> ExportToFiles(Summary summary, ILogger consoleLogger)
{
string fileName = GetFileName(summary);
string filePath = GetAtrifactFullName(summary);
string filePath = GetArtifactFullName(summary);
if (File.Exists(filePath))
{
try
Expand All @@ -46,7 +46,7 @@ public IEnumerable<string> ExportToFiles(Summary summary, ILogger consoleLogger)
return new[] { filePath };
}

internal string GetAtrifactFullName(Summary summary)
internal string GetArtifactFullName(Summary summary)
{
string fileName = GetFileName(summary);
return $"{Path.Combine(summary.ResultsDirectoryPath, fileName)}-{FileCaption}{FileNameSuffix}.{FileExtension}";
Expand Down
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/Exporters/RPlotExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class RPlotExporter : IExporter, IExporterDependencies

public IEnumerable<IExporter> Dependencies
{
// R Plots depends on having the full measurments available
// R Plots depends on having the full measurements available
get { yield return CsvMeasurementsExporter.Default; }
}

Expand All @@ -31,7 +31,7 @@ public IEnumerable<string> ExportToFiles(Summary summary, ILogger consoleLogger)
yield return scriptFileName;

string fileNamePrefix = Path.Combine(summary.ResultsDirectoryPath, summary.Title);
string csvFullPath = CsvMeasurementsExporter.Default.GetAtrifactFullName(summary);
string csvFullPath = CsvMeasurementsExporter.Default.GetArtifactFullName(summary);

string scriptFullPath = Path.Combine(summary.ResultsDirectoryPath, scriptFileName);
string logFullPath = Path.Combine(summary.ResultsDirectoryPath, logFileName);
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Extensions/AssemblyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private static DebuggableAttribute GetDebuggableAttribute(Assembly assembly)
private static bool? Read(DebuggableAttribute debuggableAttribute, string propertyName)
{
// the properties are implemented (https://github.com/dotnet/coreclr/pull/6153)
// but not exposed in corefx Contracs due to .NET Standard versioning problems (https://github.com/dotnet/corefx/issues/13717)
// but not exposed in corefx Contracts due to .NET Standard versioning problems (https://github.com/dotnet/corefx/issues/13717)
// so we need to use reflection to read this simple property...
var propertyInfo = typeof(DebuggableAttribute).GetProperty(propertyName);
if (debuggableAttribute == null || propertyInfo == null)
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Extensions/CommonExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> collectio
hashSet.Add(item);
}

#if !NETCOREAPP2_1 // method with the same name was added to Dictionary in .NET Core 2.1, so we need this ulgy hack to get compiler happy
#if !NETCOREAPP2_1 // method with the same name was added to Dictionary in .NET Core 2.1, so we need this ugly hack to get compiler happy
public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
=> dictionary.TryGetValue(key, out var value) ? value : default;
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/Helpers/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal static string RunAndReadOutput(string fileName, string arguments = "")
}

internal static IReadOnlyList<string> RunAndReadOutputLineByLine(string fileName, string arguments = "",
Dictionary<string, string> environmentVariables = null, bool includeErros = false)
Dictionary<string, string> environmentVariables = null, bool includeErrors = false)
{
var output = new List<string>(20000);

Expand All @@ -65,7 +65,7 @@ internal static IReadOnlyList<string> RunAndReadOutputLineByLine(string fileName
process.OutputDataReceived += (sender, args) => output.Add(args.Data);
process.ErrorDataReceived += (sender, args) =>
{
if (includeErros)
if (includeErrors)
output.Add(args.Data);
};

Expand Down
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/Helpers/ResourceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal static class ResourceHelper
internal static string LoadTemplate(string name)
{
var resourceName = "BenchmarkDotNet.Templates." + name;
using (var stream = GetResouceStream(resourceName))
using (var stream = GetResourceStream(resourceName))
{
if (stream == null)
throw new Exception($"Resource {resourceName} not found");
Expand All @@ -18,7 +18,7 @@ internal static string LoadTemplate(string name)
}
}

private static Stream GetResouceStream(string resourceName)
private static Stream GetResourceStream(string resourceName)
{
return typeof(ResourceHelper).GetTypeInfo().Assembly.GetManifestResourceStream(resourceName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Mathematics/NumeralSystemExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static string ToPresentation(this NumeralSystem system, int value)
// Based on http://stackoverflow.com/questions/7040289/converting-integers-to-roman-numerals
private static string ToRoman(int number)
{
if ((number < 0) || (number > 3999)) throw new ArgumentOutOfRangeException(nameof(number), "insert value betwheen 1 and 3999");
if ((number < 0) || (number > 3999)) throw new ArgumentOutOfRangeException(nameof(number), "insert value between 1 and 3999");
if (number < 1) return string.Empty;
if (number >= 1000) return "M" + ToRoman(number - 1000);
if (number >= 900) return "CM" + ToRoman(number - 900);
Expand Down
8 changes: 4 additions & 4 deletions src/BenchmarkDotNet/Parameters/SmartParamBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static object[] CreateForParams(MemberInfo source, object[] values)
if (values.IsEmpty() || values.All(value => SourceCodeHelper.IsCompilationTimeConstant(value)))
return values;

return values.Select((value, index) => new SmartParamameter(source, value, index)).ToArray();
return values.Select((value, index) => new SmartParameter(source, value, index)).ToArray();
}

internal static ParameterInstances CreateForArguments(MethodInfo benchmark, ParameterDefinition[] parameterDefinitions, (MemberInfo source, object[] values) valuesInfo, int sourceIndex)
Expand Down Expand Up @@ -78,18 +78,18 @@ public string ToSourceCode()
: string.Empty; // IEnumerable<object>

// we just execute (cast)source.ToArray()[case][argumentIndex];
// we know that source is IEnumberable so we can do that!
// we know that source is IEnumerable so we can do that!
return $"{cast}{source.Name}{callPostfix}.ToArray()[{sourceIndex}]{indexPostfix};";
}
}

internal class SmartParamameter : IParam
internal class SmartParameter : IParam
{
private readonly MemberInfo source;
private readonly MethodBase method;
private readonly int index;

public SmartParamameter(MemberInfo source, object value, int index)
public SmartParameter(MemberInfo source, object value, int index)
{
this.source = source;
this.method = source is PropertyInfo property ? property.GetMethod : source as MethodInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Reports/MeasurementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public static bool Is(this Measurement measurement, IterationMode mode, Iteratio
=> measurement.IterationMode == mode && measurement.IterationStage == stage;

public static bool IsOverhead(this Measurement measurement) => measurement.IterationMode == IterationMode.Overhead;
public static bool IsWorklaod(this Measurement measurement) => measurement.IterationMode == IterationMode.Workload;
public static bool IsWorkload(this Measurement measurement) => measurement.IterationMode == IterationMode.Workload;
}
}
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/Running/BenchmarkConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public static ReadOnlyConfig GetFullConfig(Type type, IConfig config)
var configs = allAttributes.Select(attribute => attribute.Config)
.OrderBy(c => c.GetJobs().Count(job => job.Meta.IsMutator)); // configs with mutators must be the ones applied at the end

foreach (var configFromAttrubute in configs)
config = ManualConfig.Union(config, configFromAttrubute);
foreach (var configFromAttribute in configs)
config = ManualConfig.Union(config, configFromAttribute);
}
return config.AsReadOnly();
}
Expand Down
Loading

0 comments on commit c724e94

Please sign in to comment.