From 655d70e073d955f5c98f78be437cbd8581165204 Mon Sep 17 00:00:00 2001 From: "Tomohisa Tanaka (Maroontress)" Date: Sat, 28 Mar 2020 12:52:47 +0900 Subject: [PATCH] Update version 1.0.25. (#154) - Update README. --- README.md | 139 +++--------------- .../source.extension.vsixmanifest | 2 +- StyleChecker/StyleChecker/StyleChecker.csproj | 2 +- 3 files changed, 24 insertions(+), 119 deletions(-) diff --git a/README.md b/README.md index 5033e8e2..58babcd4 100644 --- a/README.md +++ b/README.md @@ -5,113 +5,20 @@ StyleChecker is yet another code style checker and refactoring tool like [StyleCop Analyzers][stylecopanalyzers], [SonarLint][sonarlint], [Roslynator][roslynator], -and so on. -It contains only supplemental or niche analyzers, -so it is intended to be used together with them. - -## Rules - -There are the following categories of the diagnostics analyzers: -Cleaning, Document, Naming, Ordering, Refactoring, Settings, Size, -and Spacing. - -### Cleaning - -- [ByteOrderMark](doc/rules/ByteOrderMark.md) - — Remove a UTF-8 BOM. -- [RedundantTypedArrayCreation](doc/rules/RedundantTypedArrayCreation.md) - — Use an implicitly-typed array creation. -- [UnusedUsing](doc/rules/UnusedUsing.md) — - Remove unnecessary using directives. -- [UnusedVariable](doc/rules/UnusedVariable.md) — - Remove unused local variables. - -### Document - -- [NoDocumentation](doc/rules/NoDocumentation.md) - — A replacement for [CS1591][cs1591] (Missing XML comment for - publicly visible type or member), [SA1600][sa1600] (Elements should - be documented), and so on. It can be configured so that the entity - with the specified attribute can be ignored. - -### Naming - -- [SingleTypeParameter](doc/rules/SingleTypeParameter.md) — - Use `T` as a type parameter name if the type parameter is single. -- [ThoughtlessName](doc/rules/ThoughtlessName.md) — - Avoid thoughtless names for the identifier of local variables. -- [Underscore](doc/rules/Underscore.md) — - Avoid including an underscore character (`_`) in the identifier of local - variables. - -### Ordering - -- [PostIncrement](doc/rules/PostIncrement.md) — - Avoid post-increment/decrement operators (e.g. `i++`) if they can be - replaced with pre-increment/decrement ones. - -### Refactoring - -- [AssignmentToParameter](doc/rules/AssignmentToParameter.md) — - Avoid assignment to the parameters passed _by value_. -- [DiscardingReturnValue](doc/rules/DiscardingReturnValue.md) — - Don't discard the return value of some delicate methods like - `System.IO.Stream.Read(byte[], int, int)`. -- [EmptyArrayCreation](doc/rules/EmptyArrayCreation.md) — - Don't create empty arrays, use `System.Array.Empty` instead. -- [EqualsNull](doc/rules/EqualsNull.md) — - Use `is null` pattern matching instead of `==` operator. -- [IneffectiveReadByte](doc/rules/IneffectiveReadByte.md) — - Avoid invoking `ReadByte()` method of `System.IO.BinaryReader` class - in incremental `for` loops. -- [IsNull](doc/rules/IsNull.md) — - Use `==` operator with `null` instead of `is null` pattern matching. -- [NotDesignedForExtension](doc/rules/NotDesignedForExtension.md) — - Must design a class for inheritance, or else prohibit it. -- [StaticGenericClass](doc/rules/StaticGenericClass.md) — - Move type parameters from the static class to its methods if possible. -- [TypeClassParameter](doc/rules/TypeClassParameter.md) — - Replace the parameter of methods or local functions with a type parameter, - if its type is `System.Type` and every argument for it is a `typeof()` - operator. -- [UnnecessaryUsing](doc/rules/UnnecessaryUsing.md) — - Avoid `using` statements for some types that have no resources to dispose of. - -### Settings - -- [InvalidConfig](doc/rules/InvalidConfig.md) — - Validate the configuration file `StyleChecker.xml`. - -### Size - -- [LongLine](doc/rules/LongLine.md) — - Avoid a long line. In default, it allows less than 80 columns, - but the length can be configured. - -### Spacing - -- [SpaceBeforeSemicolon](doc/rules/SpaceBeforeSemicolon.md), - [NoSpaceAfterSemicolon](doc/rules/NoSpaceAfterSemicolon.md) — - Regulate spacing around a semicolon, especially in `for` statements. - The style `for (;;)` of an infinite `for` loop is allowed. - Note that this rule is realized with SpaceBeforeSemicolon and - NoSpaceAfterSemicolon analyzers, and they are a replacement for - [SA1002][sa1002]. -- [NoSingleSpaceAfterTripleSlash](doc/rules/NoSingleSpaceAfterTripleSlash.md) - — Regulate spacing after triple slash (Single Line Documentation Comment). - It is a replacement for [SA1004][sa1004]. - -## Requirements to run - -Visual Studio 2017 (15.9) or .NET Core 2.1 (2.1.500) - -## Requirements to build - -Visual Studio 2019 (16.0) - -## Install StyleChecker to your project - -### with Visual Studio +and so on. It uses +[the .NET Compiler Platform ("Roslyn")](https://github.com/dotnet/roslyn) +to analyze the C# source code of .NET Core projects and outputs diagnostics +of a rule violation, +and when running with Visual Studio it provides code fixes as much as possible. +Note that StyleChecker contains only supplemental or niche analyzers, +so it is intended to be used together with other Roslyn analyzers. + +## Get started + +StyleChecker is available as +[the ![NuGet-logo][nuget-logo] NuGet package][nuget-stylechecker]. + +### Install StyleChecker to your project with Visual Studio 1. Open Package Manager Console. (Open your project with Visual Studio, and select Tools @@ -126,7 +33,7 @@ Visual Studio 2019 (16.0) ➜ Click StyleChecker with a right button to open StyleChecker Package Properties, and then enter `all` to the `PrivateAssets` field.) -### with .NET Core CLI +### Install StyleChecker to your project with .NET Core CLI 1. Enter the command `dotnet add package StyleChecker` with the console. 2. Open your project file (`.csproj`) using a text editor like Visual Studio @@ -138,7 +45,11 @@ Visual Studio 2019 (16.0) ``` -## Configuration +## Diagnostics + +See [the list of diagnostics](doc/rules). + +## Customize configuration Some analyzers can be customized to change their behaviors, placing the configuration file `StyleChecker.xml` at the project root. @@ -174,11 +85,5 @@ Solution Explorer [stylecopanalyzers]: https://github.com/DotNetAnalyzers/StyleCopAnalyzers [sonarlint]: https://github.com/SonarSource/sonarlint-visualstudio [roslynator]: https://github.com/JosefPihrt/Roslynator -[cs1591]: - https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1591 -[sa1002]: - https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1002.md -[sa1004]: - https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1004.md -[sa1600]: - https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1600.md +[nuget-stylechecker]: https://www.nuget.org/packages/StyleChecker/ +[nuget-logo]: https://maroontress.github.io/images/NuGet-logo.png diff --git a/StyleChecker/StyleChecker.Vsix/source.extension.vsixmanifest b/StyleChecker/StyleChecker.Vsix/source.extension.vsixmanifest index 2b1f1876..e0d27c1c 100644 --- a/StyleChecker/StyleChecker.Vsix/source.extension.vsixmanifest +++ b/StyleChecker/StyleChecker.Vsix/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + StyleChecker StyleChecker is yet another style checker for C#. diff --git a/StyleChecker/StyleChecker/StyleChecker.csproj b/StyleChecker/StyleChecker/StyleChecker.csproj index 105ec82a..eca96005 100644 --- a/StyleChecker/StyleChecker/StyleChecker.csproj +++ b/StyleChecker/StyleChecker/StyleChecker.csproj @@ -20,7 +20,7 @@ Copyright (c) 2018 Maroontress Fast Software csharp, visual-studio, roslyn, analyzer, roslyn-analyzer, roslyn-codefix, stylechecker true - 1.0.24.0 + 1.0.25.0 Maroontress Fast Software 1.0.1