diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ccf8162..def679d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -47,4 +47,4 @@ jobs: dotnet add StyleChecker/StyleChecker.Test/StyleChecker.Test.csproj package StyleChecker --version ${{ env.STYLECHECKER_VERSION }} dotnet build --configuration Release env: - STYLECHECKER_VERSION: 2.0.0 + STYLECHECKER_VERSION: 2.0.1-alpha diff --git a/StyleChecker/StyleChecker/StyleChecker.csproj b/StyleChecker/StyleChecker/StyleChecker.csproj index e110594..0c94e09 100644 --- a/StyleChecker/StyleChecker/StyleChecker.csproj +++ b/StyleChecker/StyleChecker/StyleChecker.csproj @@ -24,7 +24,7 @@ Copyright (c) 2018 Maroontress Fast Software csharp, visual-studio, roslyn, analyzer, roslyn-analyzer, roslyn-codefix, stylechecker true - 2.0.1-alpha + 2.0.1-beta Maroontress Fast Software README.md diff --git a/doc/rules/NoSingleSpaceAfterTripleSlash.md b/doc/rules/NoSingleSpaceAfterTripleSlash.md index 7e92912..973a116 100644 --- a/doc/rules/NoSingleSpaceAfterTripleSlash.md +++ b/doc/rules/NoSingleSpaceAfterTripleSlash.md @@ -1,3 +1,4 @@ +
@@ -42,6 +43,51 @@ This analyzer does not report diagnostics to the code, which includes a line break inside the start/end tags of an XML element, as long as a single space follows `///`. +## Remarks + +A `///` followed by a single space is simply not correct. More correctly, `///` +must be followed by a single space followed by an XML element +(`` or ``). If the XML element is long, it can +be wrapped, but each wrapped line must begin with `///` followed by one or more +whitespace characters. The following is a conformance example: + +```csharp +/// Hello. +/// +public static void Good() +{ +} + +/// Hello +/// World. +public static void GoodWithWrapping() +{ +} +``` + +The following is a nonconformance example: + +```csharp +/// Hello World. +/// See +public static void Bad() +{ +} + +/// Hello. +public static void BadWithNoElements() +{ +} +``` + +The analyzer also issued diagnostics for `Hello` and `See` in `Bad()` up to +version 2.0.0, but not since 2.0.1. The warning was “A single white space +is needed after '///',” but “A single white space should only be +between '///' and an XML element” was more appropriate. + +Even after version 2.0.1, [StrayText analyzer](StrayText.md) reports `Bad()` and +`BadWithNoElements()` instead of this analyzer. + ## Code fix The code fix provides an option inserting a single space after `///`,