Skip to content

Commit f8e0a5c

Browse files
authored
Automated spellcheck for docs via GitHub Actions (and address all raised issues) (#2144)
* Add GH Action * add cSpell Config * Ignore team page Mostly names * capitalize GUID * add some terms * add known terms * fix: "disassemblers" * add known words * ignore changelog many names and many link to issues that will be copy/paste and could contain spelling errors * more known terms * Known terms. * Fix: "priorities" * fix: priorities * known term * add back-ticks * fix: characteristic / minor grammar * fix: variance * add word * back-ticks * fix: "specify" * back-ticks * add terms * front-matter ignore of configoptions * back-ticks * back-ticks * add terms * frontmatter ignore Since term is only in front-matte * fix: "log file" * separate words from ignoreWords * Fix branch for GH Action * ignores of runstrategy in frontmatter
1 parent 8d23796 commit f8e0a5c

File tree

15 files changed

+208
-49
lines changed

15 files changed

+208
-49
lines changed

.github/workflows/spellcheck.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Documentation Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "docs/**/*"
9+
pull_request:
10+
branches:
11+
- master
12+
paths:
13+
- "docs/**/*"
14+
jobs:
15+
spellcheck:
16+
name: "Docs: Spellcheck"
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
name: Check out the code
21+
- uses: actions/setup-node@v1
22+
name: Setup node
23+
with:
24+
node-version: "16"
25+
- run: npm install -g cspell
26+
name: Install cSpell
27+
- run: cspell --config ./cSpell.json "docs/**/*.md" --no-progress
28+
name: Run cSpell

cSpell.json

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"words": [
5+
"Alloc",
6+
"analyse",
7+
"analyser",
8+
"Analysers",
9+
"Autofac",
10+
"bitness",
11+
"corlib",
12+
"Cygwin",
13+
"Diagnoser",
14+
"diagnosers",
15+
"disassemblers",
16+
"disassm",
17+
"Jits",
18+
"Jitting",
19+
"LINQ",
20+
"microbenchmarking",
21+
"microbenchmarks",
22+
"Mispredict",
23+
"Mispredictions",
24+
"msbuild",
25+
"Multimodal",
26+
"multimodality",
27+
"netcoreapp",
28+
"powerplans",
29+
"Pseudocode",
30+
"runtimes",
31+
"Serilog",
32+
"Tailcall",
33+
"toolchains",
34+
"unmanaged"
35+
],
36+
"ignoreWords": [
37+
"Akinshin",
38+
"Andrey",
39+
"Expecto",
40+
"Jint",
41+
"LoongArch64",
42+
"macrobenchmark",
43+
"MediatR",
44+
"Nagórski's",
45+
"Newtonsoft",
46+
"NodaTime",
47+
"Npgsql",
48+
"Sitnik's",
49+
"Wojciech",
50+
"Avalonia",
51+
"Gitter"
52+
],
53+
"patterns": [
54+
{
55+
"name": "Markdown links",
56+
"pattern": "\\((.*)\\)",
57+
"description": ""
58+
},
59+
{
60+
"name": "Markdown code blocks",
61+
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
62+
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
63+
},
64+
{
65+
"name": "Inline code blocks",
66+
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
67+
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
68+
},
69+
{
70+
"name": "Link contents",
71+
"pattern": "\\<a(.*)\\>",
72+
"description": ""
73+
},
74+
{
75+
"name": "Snippet references",
76+
"pattern": "-- snippet:(.*)",
77+
"description": ""
78+
},
79+
{
80+
"name": "Snippet references 2",
81+
"pattern": "\\<\\[sample:(.*)",
82+
"description": "another kind of snippet reference"
83+
},
84+
{
85+
"name": "Multi-line code blocks",
86+
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
87+
},
88+
{
89+
"name": "HTML Tags",
90+
"pattern": "<[^>]*>",
91+
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string"
92+
}
93+
],
94+
"ignoreRegExpList": [
95+
"Markdown links",
96+
"Markdown code blocks",
97+
"Inline code blocks",
98+
"Link contents",
99+
"Snippet references",
100+
"Snippet references 2",
101+
"Multi-line code blocks",
102+
"HTML Tags"
103+
],
104+
"ignorePaths": [
105+
"docs/_changelog/**/*.md",
106+
"docs/articles/team.md"
107+
]
108+
}

docs/articles/configs/configoptions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
#cspell:ignore configoptions
23
uid: docs.configoptions
34
name: Configoptions
45
---

docs/articles/configs/filters.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ In this case, you can *filter* some of them with the help of *filters*.
1010

1111
Predefined filters:
1212

13-
| Filter Type | Filters benchmarks by | Console argument | Console example |
14-
|---------------------|-----------------------------|------------------|----------------------------------|
15-
| GlobFilter | Provided glob pattern | filter | --filter *Serializer*.ToStream |
16-
| AttributesFilter | Provided attribute names | attribute | --attribute STAThread |
17-
| AllCategoriesFilter | All Provided category names | categories | --allCategories Priority1 CoreFX |
18-
| AnyCategoriesFilter | Any provided category names | anycategories | --anyCategories Json Xml |
19-
| SimpleFilter | Provided lambda predicate | - | |
20-
| NameFilter | Provided lambda predicate | - | |
21-
| UnionFilter | Logical AND | - | |
22-
| DisjunctionFilter | Logical OR | - | |
13+
| Filter Type | Filters benchmarks by | Console argument | Console example |
14+
|---------------------|-----------------------------|--------------------|----------------------------------|
15+
| GlobFilter | Provided glob pattern | `filter` | --filter *Serializer*.ToStream |
16+
| AttributesFilter | Provided attribute names | `attribute` | --attribute STAThread |
17+
| AllCategoriesFilter | All Provided category names | `categories` | --allCategories Priority1 CoreFX |
18+
| AnyCategoriesFilter | Any provided category names | `anycategories` | --anyCategories Json Xml |
19+
| SimpleFilter | Provided lambda predicate | - | |
20+
| NameFilter | Provided lambda predicate | - | |
21+
| UnionFilter | Logical AND | - | |
22+
| DisjunctionFilter | Logical OR | - | |
2323

2424
---
2525

2626
[!include[IntroFilters](../samples/IntroFilters.md)]
2727

2828
[!include[IntroCategories](../samples/IntroCategories.md)]
2929

30-
[!include[IntroJoin](../samples/IntroJoin.md)]
30+
[!include[IntroJoin](../samples/IntroJoin.md)]

docs/articles/configs/jobs.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ Basically, a *job* describes how to run your benchmark. Practically, it's a set
1212
There are several categories of characteristics which you can specify. Let's consider each category in detail.
1313

1414
### Id
15+
1516
It's a single string characteristic. It allows to name your job. This name will be used in logs and a part of a folder name with generated files for this job. `Id` doesn't affect benchmark results, but it can be useful for diagnostics. If you don't specify `Id`, random value will be chosen based on other characteristics
1617

1718
### Environment
19+
1820
`Environment` specifies an environment of the job. You can specify the following characteristics:
1921

2022
* `Platform`: `x86` or `x64`
@@ -41,7 +43,8 @@ It's a single string characteristic. It allows to name your job. This name will
4143
BenchmarkDotNet will use host process environment characteristics for non specified values.
4244

4345
### Run
44-
In this category, you can specifiy how to benchmark each method.
46+
47+
In this category, you can specify how to benchmark each method.
4548

4649
* `RunStrategy`:
4750
* `Throughput`: default strategy which allows to get good precision level
@@ -61,16 +64,18 @@ In this category, you can specifiy how to benchmark each method.
6164
Usually, you shouldn't specify such characteristics like `LaunchCount`, `WarmupCount`, `TargetCount`, or `IterationTime` because BenchmarkDotNet has a smart algorithm to choose these values automatically based on received measurements. You can specify it for testing purposes or when you are damn sure that you know the right characteristics for your benchmark (when you set `TargetCount` = `20` you should understand why `20` is a good value for your case).
6265

6366
### Accuracy
67+
6468
If you want to change the accuracy level, you should use the following characteristics instead of manually adjusting values of `WarmupCount`, `TargetCount`, and so on.
6569

6670
* `MaxRelativeError`, `MaxAbsoluteError`: Maximum acceptable error for a benchmark (by default, BenchmarkDotNet continue iterations until the actual error is less than the specified error). *In these two characteristics*, the error means half of 99.9% confidence interval. `MaxAbsoluteError` is an absolute `TimeInterval`; doesn't have a default value. `MaxRelativeError` defines max acceptable (`(<half of CI 99.9%>) / Mean`).
6771
* `MinIterationTime`: Minimum time of a single iteration. Unlike `Run.IterationTime`, this characteristic specifies only the lower limit. In case of need, BenchmarkDotNet can increase this value.
6872
* `MinInvokeCount`: Minimum about of target method invocation. Default value if `4` but you can decrease this value for cases when single invocations takes a lot of time.
69-
* `EvaluateOverhead`: if you benchmark method takes nanoseconds, BenchmarkDotNet overhead can significantly affect measurements. If this characterics is enable, the overhead will be evaluated and subtracted from the result measurements. Default value is `true`.
73+
* `EvaluateOverhead`: if your benchmark method takes nanoseconds, BenchmarkDotNet overhead can significantly affect measurements. If this characteristic is enabled, the overhead will be evaluated and subtracted from the result measurements. Default value is `true`.
7074
* `WithOutlierMode`: sometimes you could have outliers in your measurements. Usually these are unexpected outliers which arose because of other processes activities. By default (`OutlierMode.RemoveUpper`), all upper outliers (which is larger than Q3) will be removed from the result measurements. However, some of benchmarks have *expected* outliers. In these situation, you expect that some of invocation can produce outliers measurements (e.g. in case of network activities, cache operations, and so on). If you want to see result statistics with these outliers, you should use `OutlierMode.DontRemove`. If you can also choose `OutlierMode.RemoveLower` (outliers which are smaller than Q1 will be removed) or `OutlierMode.RemoveAll` (all outliers will be removed). See also: @BenchmarkDotNet.Mathematics.OutlierMode
71-
* `AnalyzeLaunchVariance`: this characteristic makes sense only if `Run.LaunchCount` is default. If this mode is enabled and, BenchmarkDotNet will try to perform several launches and detect if there is a veriance between launches. If this mode is disable, only one launch will be performed.
75+
* `AnalyzeLaunchVariance`: this characteristic makes sense only if `Run.LaunchCount` is default. If this mode is enabled and, BenchmarkDotNet will try to perform several launches and detect if there is a variance between launches. If this mode is disable, only one launch will be performed.
7276

7377
### Infrastructure
78+
7479
Usually, you shouldn't specify any characteristics from this section, it can be used for advanced cases only.
7580

7681
* `Toolchain`: a toolchain which generates source code for target benchmark methods, builds it, and executes it. BenchmarkDotNet has own toolchains for .NET, .NET Core, Mono and CoreRT projects. If you want, you can define own toolchain.
@@ -121,18 +126,24 @@ Basically, it's a good idea to start with predefined values (e.g. `EnvMode.RyuJi
121126

122127
Note that the job cannot be modified after it's added into config. Trying to set a value on property of the frozen job will throw an `InvalidOperationException`. Use the `Job.Frozen` property to determine if the code properties can be altered.
123128

124-
If you do want to create a new job based on frozen one (all predefined job values are frozen) you can use the `.With()` extension method
129+
If you do want to create a new job based on frozen one (all predefined job values are frozen) you can use the `.With()` extension method
130+
125131
```cs
126132
var newJob = Job.Dry.With(Platform.X64);
127133
```
134+
128135
or pass the frozen value as a constructor argument
136+
129137
```c#
130138
var newJob = new Job(Job.Dry) { Env = { Platform = Platform.X64 } };
131139
```
140+
132141
or use the `.Apply()` method on unfrozen job
142+
133143
```c#
134144
var newJob = new Job() { Env = { Platform = Platform.X64 } }.Apply(Job.Dry);
135145
```
146+
136147
in any case the Id property will not be transfered and you must pass it explicitly (using the .ctor id argument or the `.WithId()` extension method).
137148

138149
### Attribute style

docs/articles/configs/validators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ name: Validators
55

66
# Validators
77

8-
A **validator** can validate your benchmarks before they are executed and produce validation errors.
9-
If any of the validation errors is critical, then none of the benchmarks will get executed.
8+
A **validator** can validate your benchmarks before they are executed and produce validation errors.
9+
If any of the validation errors is critical, then none of the benchmarks will get executed.
1010

1111
Available validators are:
1212

1313
* `BaselineValidator.FailOnError` - it checks if more than 1 Benchmark per class has `Baseline = true` applied. This validator is mandatory.
14-
* `JitOptimizationsValidator.(Dont)FailOnError` - it checks whether any of the referenced assemblies is non-optimized. DontFailOnError version is enabled by default.
14+
* `JitOptimizationsValidator.(Dont)FailOnError` - it checks whether any of the referenced assemblies is non-optimized. `DontFailOnError` version is enabled by default.
1515
* `ExecutionValidator.(Dont)FailOnError` - it checks if it is possible to run your benchmarks by executing each of them once. Optional.
1616
* `ReturnValueValidator.(Dont)FailOnError` - it checks if non-void benchmarks return equal values. Optional.

docs/articles/contributing/building.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ The build currently depends on the following prerequisites:
2525
- Install [Mono version 5 or higher](https://www.mono-project.com/download/stable/#download-lin)
2626
- Install [fsharp package](https://fsharp.org/use/linux/)
2727
- Install packages required to .NET Core SDK
28-
- gettext
29-
- libcurl4-openssl-dev
30-
- libicu-dev
31-
- libssl-dev
32-
- libunwind8
28+
- `gettext`
29+
- `libcurl4-openssl-dev`
30+
- `libicu-dev`
31+
- `libssl-dev`
32+
- `libunwind8`
3333

3434
- macOS
3535
- Install [Mono version 5 or higher](https://www.mono-project.com/download/stable/#download-mac)
@@ -40,15 +40,15 @@ After you have installed these pre-requisites, you can build the BenchmarkDotNet
4040

4141
Build has a number of options that you use. Some of the more important options are
4242

43-
- **skiptests** - do not run the tests. This can shorten build times quite a bit. On Windows: `.\build.ps1 --SkipTests=True` or `./build.sh --skiptests=true` on Linux/macOS.
43+
- **`skiptests`** - do not run the tests. This can shorten build times quite a bit. On Windows: `.\build.ps1 --SkipTests=True` or `./build.sh --skiptests=true` on Linux/macOS.
4444

45-
- **configuration** - build the 'Release' or 'Debug' build type. Default value is 'Release'. On Windows: `.\build.ps1 -Configuration Debug` or `./build.sh --configuration debug` on Linux/macOS.
45+
- **`configuration`** - build the 'Release' or 'Debug' build type. Default value is 'Release'. On Windows: `.\build.ps1 -Configuration Debug` or `./build.sh --configuration debug` on Linux/macOS.
4646

47-
- **target** - with this parameter you can run a specific target from build pipeline. Default value is 'Default' target. On Windows: `.\build.ps1 -Target Default` or `./build.sh --target default` on Linux/macOS. Available targets:
48-
- **Default** - run all actions one by one.
49-
- **Clean** - clean all `obj`, `bin` and `artifacts` directories.
50-
- **Restore** - automatically execute `Clean` action and after that restore all NuGet dependencies.
51-
- **Build** - automatically execute `Restore` action, then run MSBuild for the solution file.
52-
- **FastTests** - automatically execute `Build` action, then run all tests from the BenchmarkDotNet.Tests project.
53-
- **SlowTests** - automatically execute `Build` action, then run all tests from the BenchmarkDotNet.IntegrationTests project.
54-
- **Pack** - automatically execute `Build` action and after that creates local NuGet packages.
47+
- **`target`** - with this parameter you can run a specific target from build pipeline. Default value is 'Default' target. On Windows: `.\build.ps1 -Target Default` or `./build.sh --target default` on Linux/macOS. Available targets:
48+
- **`Default`** - run all actions one by one.
49+
- **`Clean`** - clean all `obj`, `bin` and `artifacts` directories.
50+
- **`Restore`** - automatically execute `Clean` action and after that restore all NuGet dependencies.
51+
- **`Build`** - automatically execute `Restore` action, then run MSBuild for the solution file.
52+
- **`FastTests`** - automatically execute `Build` action, then run all tests from the BenchmarkDotNet.Tests project.
53+
- **`SlowTests`** - automatically execute `Build` action, then run all tests from the BenchmarkDotNet.IntegrationTests project.
54+
- **`Pack`** - automatically execute `Build` action and after that creates local NuGet packages.

docs/articles/contributing/disassembler.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ We have 3 disassemblers:
1313
The MonoDisassembler is very simple: it spawns Mono with the right arguments to get the asm, Mono prints the output to the console and we just parse it. Single class does the job: `MonoDisassembler`.
1414

1515
When it comes to Windows disassemblers it's not so easy. To obtain the disassm we are using ClrMD. ClrMD can attach only to the process of same bitness (architecture).
16-
This is why we have two dissasemblers: x64 and x86. The code is the same (single class, linked in two projects) but compiled for two different architectures. We keep both disassemblers in the resources of the BenchmarkDotNet.dll. When we need the disassembler, we search for it in the resources, copy it to the disk and run (it's an exe).
16+
This is why we have two disassemblers: x64 and x86. The code is the same (single class, linked in two projects) but compiled for two different architectures. We keep both disassemblers in the resources of the BenchmarkDotNet.dll. When we need the disassembler, we search for it in the resources, copy it to the disk and run (it's an exe).
1717

1818
On Linux it's simpler (only x64 is supported) and we don't spawn a new process (everything is done in-proc).
1919

20-
2120
### How to debug the disassembler
2221

2322
You need to create a new console app project which executes the code that you would like to disassemble. In this app, you need to run the desired code (to get it jitted) and just don't exit before attaching the disassembler and getting the disassembly.

docs/articles/features/etwprofiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
#cspell:ignore etwprofiler
23
uid: docs.etwprofiler
34
name: EtwProfiler
45
---
@@ -60,7 +61,6 @@ class Program
6061

6162
* Passing `-p ETW` or `--profiler ETW` command line argument to `BenchmarkSwitcher`
6263

63-
6464
## Configuration
6565

6666
To configure the new diagnoser you need to create an instance of `EtwProfilerConfig` class and pass it to the `EtwProfiler` constructor. The parameters that `EtwProfilerConfig` ctor takes are:

docs/articles/guides/choosing-run-strategy.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
#cspell:ignore runstrategy
23
uid: docs.runstrategy
34
name: Choosing RunStrategy
45
---
@@ -28,4 +29,4 @@ public class MyBenchmarkClass
2829

2930
[!include[IntroColdStart](../samples/IntroColdStart.md)]
3031

31-
[!include[IntroMonitoring](../samples/IntroMonitoring.md)]
32+
[!include[IntroMonitoring](../samples/IntroMonitoring.md)]

0 commit comments

Comments
 (0)