Skip to content

Commit

Permalink
Update version 1.0.25. (#154)
Browse files Browse the repository at this point in the history
- Update README.
  • Loading branch information
maroontress-tomohisa committed Mar 28, 2020
1 parent 6a4e27e commit 655d70e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 119 deletions.
139 changes: 22 additions & 117 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>` instead.
- [EqualsNull](doc/rules/EqualsNull.md) &mdash;
Use `is null` pattern matching instead of `==` operator.
- [IneffectiveReadByte](doc/rules/IneffectiveReadByte.md) &mdash;
Avoid invoking `ReadByte()` method of `System.IO.BinaryReader` class
in incremental `for` loops.
- [IsNull](doc/rules/IsNull.md) &mdash;
Use `==` operator with `null` instead of `is null` pattern matching.
- [NotDesignedForExtension](doc/rules/NotDesignedForExtension.md) &mdash;
Must design a class for inheritance, or else prohibit it.
- [StaticGenericClass](doc/rules/StaticGenericClass.md) &mdash;
Move type parameters from the static class to its methods if possible.
- [TypeClassParameter](doc/rules/TypeClassParameter.md) &mdash;
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) &mdash;
Avoid `using` statements for some types that have no resources to dispose of.

### Settings

- [InvalidConfig](doc/rules/InvalidConfig.md) &mdash;
Validate the configuration file `StyleChecker.xml`.

### Size

- [LongLine](doc/rules/LongLine.md) &mdash;
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) &mdash;
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)
&mdash; 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
Expand All @@ -126,7 +33,7 @@ Visual Studio 2019 (16.0)
&#x279c; 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
Expand All @@ -138,7 +45,11 @@ Visual Studio 2019 (16.0)
<PackageReference Include="StyleChecker" Version="..." PrivateAssets="all" />
```

## 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.
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="StyleChecker.54813f7f-54ef-470a-ab56-833e37fbe4ec" Version="1.0.24" Language="en-US" Publisher="tomohisa"/>
<Identity Id="StyleChecker.54813f7f-54ef-470a-ab56-833e37fbe4ec" Version="1.0.25" Language="en-US" Publisher="tomohisa"/>
<DisplayName>StyleChecker</DisplayName>
<Description xml:space="preserve">StyleChecker is yet another style checker for C#.</Description>
</Metadata>
Expand Down
2 changes: 1 addition & 1 deletion StyleChecker/StyleChecker/StyleChecker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Copyright>Copyright (c) 2018 Maroontress Fast Software</Copyright>
<PackageTags>csharp, visual-studio, roslyn, analyzer, roslyn-analyzer, roslyn-codefix, stylechecker</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<Version>1.0.24.0</Version>
<Version>1.0.25.0</Version>
<RepositoryType />
<Company>Maroontress Fast Software</Company>
<AnnotationsVersion>1.0.1</AnnotationsVersion>
Expand Down

0 comments on commit 655d70e

Please sign in to comment.