Skip to content

Commit

Permalink
Add DoNotIgnore attribute and update version 1.0.1. (#1)
Browse files Browse the repository at this point in the history
- Update version 1.0.1.
- Fix package URLs.
- Add StyleChecker and StyleCop.Analyzers to dependencies.
- Add DoNotIgnore attribute.
- Fix API documents.
  • Loading branch information
maroontress-tomohisa committed Nov 21, 2018
1 parent a55a56a commit d23393f
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 8 deletions.
14 changes: 14 additions & 0 deletions StyleChecker.Annotations/DoNotIgnoreAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace StyleChecker.Annotations
{
using System;

/// <include file='docs.xml'
/// path='docs/members[@name="DoNotIgnore"]/DoNotIgnoreAttribute/*'/>
[AttributeUsage(
AttributeTargets.ReturnValue,
Inherited = false,
AllowMultiple = false)]
public sealed class DoNotIgnoreAttribute : Attribute
{
}
}
24 changes: 20 additions & 4 deletions StyleChecker.Annotations/StyleChecker.Annotations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,37 @@

<PropertyGroup>
<PackageId>StyleChecker.Annotations</PackageId>
<PackageVersion>1.0.0.0</PackageVersion>
<PackageVersion>1.0.1.0</PackageVersion>
<Authors>Tomohisa Tanaka</Authors>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://maroontress.github.io/StyleChecker.Annotations/</PackageProjectUrl>
<PackageProjectUrl>https://maroontress.github.io/StyleChecker-Annotations/</PackageProjectUrl>
<RepositoryUrl>https://github.com/maroontress/StyleChecker.Annotations</RepositoryUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>Annotations used with StyleChecker.</Description>
<PackageReleaseNotes>See https://maroontress.github.io/StyleChecker.Annotations/releasenotes.html</PackageReleaseNotes>
<PackageReleaseNotes>See https://maroontress.github.io/StyleChecker-Annotations/releasenotes.html</PackageReleaseNotes>
<Copyright>Copyright (c) 2018 Maroontress Fast Software</Copyright>
<PackageTags>StyleChecker, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<Version>1.0.0.0</Version>
<Version>1.0.1.0</Version>
<RepositoryType />
<Company>Maroontress Fast Software</Company>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>StyleChecker.Annotations.xml</DocumentationFile>
<CodeAnalysisRuleSet>StyleChecker.Annotations.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet>StyleChecker.Annotations.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StyleChecker" Version="1.0.14" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-beta.61" PrivateAssets="all">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
75 changes: 75 additions & 0 deletions StyleChecker.Annotations/StyleChecker.Annotations.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="10.0">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="MinimumRecommendedRules_Name" />
<Description Resource="MinimumRecommendedRules_Description" />
</Localization>
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<Rule Id="CA1301" Action="Warning" />
<Rule Id="CA1400" Action="Warning" />
<Rule Id="CA1401" Action="Warning" />
<Rule Id="CA1403" Action="Warning" />
<Rule Id="CA1404" Action="Warning" />
<Rule Id="CA1405" Action="Warning" />
<Rule Id="CA1410" Action="Warning" />
<Rule Id="CA1415" Action="Warning" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA1901" Action="Warning" />
<Rule Id="CA2002" Action="Warning" />
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2101" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
<Rule Id="CA2200" Action="Warning" />
<Rule Id="CA2202" Action="Warning" />
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2212" Action="Warning" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2220" Action="Warning" />
<Rule Id="CA2229" Action="Warning" />
<Rule Id="CA2231" Action="Warning" />
<Rule Id="CA2232" Action="Warning" />
<Rule Id="CA2235" Action="Warning" />
<Rule Id="CA2236" Action="Warning" />
<Rule Id="CA2237" Action="Warning" />
<Rule Id="CA2238" Action="Warning" />
<Rule Id="CA2240" Action="Warning" />
<Rule Id="CA2241" Action="Warning" />
<Rule Id="CA2242" Action="Warning" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1629" Action="None" />
</Rules>
</RuleSet>
6 changes: 2 additions & 4 deletions StyleChecker.Annotations/UnusedAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ namespace StyleChecker.Annotations
{
using System;

/// <summary>
/// The annotation for the UnusedVariable analyzer of StyleChecker,
/// which marks a parameter as a unused.
/// </summary>
/// <include file='docs.xml'
/// path='docs/members[@name="Unused"]/UnusedAttribute/*'/>
[AttributeUsage(
AttributeTargets.Parameter,
Inherited = false,
Expand Down
36 changes: 36 additions & 0 deletions StyleChecker.Annotations/docs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<docs>
<members name="Unused">
<UnusedAttribute>
<summary>
The annotation for the
<a href="https://github.com/maroontress/StyleChecker/blob/master/doc/rules/UnusedVariable.md">UnusedVariable</a>
analyzer, which marks a parameter as unused.
</summary>
<example>
<code>
public override void CustomizePoint([Unused] object useIfNeeded)
{
}
</code>
</example>
</UnusedAttribute>
</members>
<members name="DoNotIgnore">
<DoNotIgnoreAttribute>
<summary>
The annotation for the
<a href="https://github.com/maroontress/StyleChecker/blob/master/doc/rules/DiscardingReturnValue.md">DiscardingReturnValue</a>
analyzer, which marks a return value as unable to ignore.
</summary>
<example>
<code>
[return: DoNotIgnore]
public override int Read(byte[] buffer)
{
return stream.Read(buffer, 0, buffer.Length);
}
</code>
</example>
</DoNotIgnoreAttribute>
</members>
</docs>

0 comments on commit d23393f

Please sign in to comment.