CodeInspect.Attributes 0.1.0

.NET Standard 2.0
dotnet add package CodeInspect.Attributes --version 0.1.0
NuGet\Install-Package CodeInspect.Attributes -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeInspect.Attributes" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodeInspect.Attributes --version 0.1.0
#r "nuget: CodeInspect.Attributes, 0.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install CodeInspect.Attributes as a Cake Addin
#addin nuget:?package=CodeInspect.Attributes&version=0.1.0

// Install CodeInspect.Attributes as a Cake Tool
#tool nuget:?package=CodeInspect.Attributes&version=0.1.0


This is free .NET Standard 2.0 library for Code style inspection. You can use this library with .NET Core >= 2.0 and .NET Framework >= 4.61


Getting Started

These instructions will help you to attach this library to your project


Instalation with Nuget

Install-Package CodeInspect

Optionally you can add package with attributes like [CodeInspectIgnore]
Install-Package CodeInspect.Attributes


In Xunit project examples:

Inspect all fields names in the assembly

Fields should have names longer than 2 chars and shorter than 30 chars

Every not specified fields (like public or internal fields) are forbidden in this scenario

Every private and protected fields name must starts with "_"

Every static fields name must start lower case

public void CheckFields_Names_InAssembly()
    var inspectResult = Inspect

    Assert.True(inspectResult.IsOk, inspectResult.GetErrorMessage());

Inspect all methods in the namespace

Every method should have name not shorter than 2 chars, not longer than 30 chars, no more args than 6

Every parameter of method should have name starts with lowecase, param name not shorter than 2 chars, param name cannot be longer than 15 chars

Every private method must have return value

public void CheckMethods_NamesAndArgs_InNamespace()
    var inspectResult = Inspect

    Assert.True(inspectResult.IsOk, inspectResult.GetErrorMessage());

Inspect all properties in the namespace

Every property name cannot be shorter than 2 chars, name must be shorter than 30 chars, each propertys name must starts capital letter

Every public property must have attribute DataMemberAttribute

Private properties AreForbidden

public void CheckProperties_Attributes_InContract()
    var inspectResult = Inspect

    Assert.True(inspectResult.IsOk, inspectResult.GetErrorMessage());

Inspect all types in the namespace

Types names cannot be shorter than 2 chars and longer than 30 chars. Name must starts with capital letter

Every type must have default constructor, not more methods than 20, not more methods than 10 and inherits class ContractBase

public void CheckTypes_HasDefaultConstructors_InNamespace()
    var inspectResult = Inspect

    Assert.True(inspectResult.IsOk, inspectResult.GetErrorMessage());



This project is licensed under the Apache License 2.0 - see the LICENSE file for details

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CodeInspect.Attributes:

Package Downloads

CodeInspect library helps you get right noding convention and naming convention

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 385 11/10/2019