Skip to content

Commit

Permalink
chore: Correct some linting errors and spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelbu authored Nov 19, 2023
1 parent e185aaa commit d20363c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/linters/.markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MD024: false
MD013:
line_length: 120
code_blocks: false
ignore_code_blocks: true
tables: false
MD026: false
MD046: false # Mix of indented and fenced code blocks
Expand Down
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"hotfix",
"hotfixes",
"intellisense",
"Interpolatable",
"ints",
"JetBrains",
"Linq",
Expand Down
2 changes: 1 addition & 1 deletion documentation/NUnit2015.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void Test()

## How to fix violations

The analyzer comes with a code fix that will replace `ClassicAssert.AreSame(expected, actual)` with
The analyzer comes with a code fix that will replace `ClassicAssert.AreSame(expected, actual)` with
`Assert.That(actual, Is.SameAs(expected))`. So the code block above will be changed into.

```csharp
Expand Down
12 changes: 6 additions & 6 deletions documentation/NUnit2050.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ These are parameters automatically supplied by the compiler.

To facilitate this, we needed to drop support for
[composite formatting](https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting)
All NUnit4 asserts only allow a single *message* parameter which can be either a simple string literal
All NUnit4 asserts only allow a single _message_ parameter which can be either a simple string literal
or a [interpolatable string](https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/string-interpolation)

This analyzer needs to be run when still building against NUnit3 as otherwise your code won't compile.
Expand All @@ -32,7 +32,7 @@ into an interpolated string.

Once you moved to NUnit4 the analyzer has some limited functionality as there are a few
cases where your NUnit3 code will compile on NUnit4, but not the way you want it.
Here what you think are parameters to a format specification are actually interpreted as
Here what you think are parameters to a format specification are actually interpreted as
the _actual_ and _constraint_ expression strings.
Unfortunately you only find that out when the test fails, which could be never.

Expand All @@ -50,7 +50,7 @@ public void MustBeMultipleOf3(int value)

Will fail with the following message:

```
```plaintext
Expected value (4) to be multiple of 3
Expected: 0
But was: 1
Expand Down Expand Up @@ -88,7 +88,7 @@ public void TestMessage(string actual, string expected)

When using NUnit3, this results in:

```
```plaintext
Expected 'NUnit 3', but got: 'NUnit 4'
String lengths are both 7. Strings differ at index 6.
Expected: "NUnit 3"
Expand All @@ -98,7 +98,7 @@ When using NUnit3, this results in:

But when using NUnit4, we get:

```
```plaintext
Message: 
Expected '{0}', but got: '{1}'
Assert.That(NUnit 3, NUnit 4)
Expand All @@ -121,7 +121,7 @@ public void TestMessage(string actual, string expected)

and the output:

```
```plaintext
Message: 
Expected 'NUnit 3', but got: 'NUnit 4'
Assert.That(actual, Is.EqualTo(expected))
Expand Down
8 changes: 4 additions & 4 deletions documentation/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Overview of implemented NUnit diagnostics and code fixes
# Overview of implemented NUnit diagnostics and code fixes

In the tables below we use the following symbols:

Expand All @@ -13,7 +13,7 @@ The severity of a diagnostic can the one of the following (in increasing severit
* :warning: - indicates a severity of **Warning**
* :exclamation: - indicates a severity of **Error**

### Structure Rules (NUnit1001 - )
## Structure Rules (NUnit1001 - )

Rules which enforce structural requirements on the test code.

Expand Down Expand Up @@ -52,7 +52,7 @@ Rules which enforce structural requirements on the test code.
| [NUnit1031](https://github.com/nunit/nunit.analyzers/tree/master/documentation/NUnit1031.md) | The individual arguments provided by a ValuesAttribute must match the type of the corresponding parameter of the method | :white_check_mark: | :exclamation: | :x: |
| [NUnit1032](https://github.com/nunit/nunit.analyzers/tree/master/documentation/NUnit1032.md) | An IDisposable field/property should be Disposed in a TearDown method | :white_check_mark: | :exclamation: | :x: |

### Assertion Rules (NUnit2001 - )
## Assertion Rules (NUnit2001 - )

Rules which improve assertions in the test code.

Expand Down Expand Up @@ -109,7 +109,7 @@ Rules which improve assertions in the test code.
| [NUnit2049](https://github.com/nunit/nunit.analyzers/tree/master/documentation/NUnit2049.md) | Consider using Assert.That(...) instead of CollectionAssert(...) | :white_check_mark: | :warning: | :white_check_mark: |
| [NUnit2050](https://github.com/nunit/nunit.analyzers/tree/master/documentation/NUnit2050.md) | NUnit 4 no longer supports string.Format specification | :white_check_mark: | :exclamation: | :white_check_mark: |

### Suppressor Rules (NUnit3001 - )
## Suppressor Rules (NUnit3001 - )

Rules which suppress compiler errors based on context. Note that these rules are only available in the .NET Standard 2.0
builds (version 3.0.0 and above) which require Visual Studio 2019.
Expand Down

0 comments on commit d20363c

Please sign in to comment.