From 0b5a04c1296df40d9ddae486bac0b00b355f9bc6 Mon Sep 17 00:00:00 2001 From: Tomohisa Tanaka Date: Sun, 11 Aug 2024 20:41:44 +0900 Subject: [PATCH] Bump version to 2.0.1-beta --- .github/workflows/dotnet.yml | 2 +- StyleChecker/StyleChecker/StyleChecker.csproj | 2 +- doc/rules/NoSingleSpaceAfterTripleSlash.md | 46 +++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ccf81625..def679db 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 e1105943..0c94e095 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 7e92912e..973a116d 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 `///`,