Skip to content

Commit

Permalink
Merge pull request #1 from snovak7/main
Browse files Browse the repository at this point in the history
Preparations for release v0.1.0
  • Loading branch information
snovak7 authored Apr 14, 2023
2 parents 1328363 + 77457d3 commit 2b5d764
Show file tree
Hide file tree
Showing 14 changed files with 206 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*]
charset = utf-8
insert_final_newline = true
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: dotnet build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore .NET Packages
run: dotnet restore
- name: Build .NET Solution
run: dotnet build --configuration Release --no-restore
- name: Pack .NET Solution
run: dotnet pack --no-build --output pack/
- name: Publish .NET Solution to GitHub Packages
continue-on-error: true
run: dotnet nuget push pack/* --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Publish .NET Solution to NuGet.org
continue-on-error: true
run: dotnet nuget push pack/* --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# JetBrains
.idea/
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/escendit/Escendit.Tools.CodeAnalysis.SonarAnalyzers</RepositoryUrl>
</PropertyGroup>
</Project>
13 changes: 13 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<PackageReference Include="Escendit.Tools.Branding" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
27 changes: 27 additions & 0 deletions Escendit.Tools.CodeAnalysis.SonarAnalyzers.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7C304639-7117-41C0-A3FC-2F60441771A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Tools.CodeAnalysis.SonarAnalyzers", "src\Escendit.Tools.CodeAnalysis.SonarAnalyzers\Escendit.Tools.CodeAnalysis.SonarAnalyzers.csproj", "{857E0A67-A491-4C55-B948-C8B72EC097E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{857E0A67-A491-4C55-B948-C8B72EC097E0} = {7C304639-7117-41C0-A3FC-2F60441771A5}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{857E0A67-A491-4C55-B948-C8B72EC097E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{857E0A67-A491-4C55-B948-C8B72EC097E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{857E0A67-A491-4C55-B948-C8B72EC097E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{857E0A67-A491-4C55-B948-C8B72EC097E0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
branches:
master:
mode: ContinuousDeployment
tag: rc
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# Escendit.Tools.CodeAnalysis.SonarAnalyzers
Sonar Analyzer Defaults
# NuGet Package: Escendit.Tools.CodeAnalysis.SonarAnalyzers

This NuGet package leverages the power of Sonar Analyzers
to enforce code quality standards that are tailored to the organization's specific needs.
By default,
the package uses a set of analyzer rules that have been configured to align with the organization's coding practices,
ensuring that our code is always compliant and maintainable.

Key features:

- Utilize Roslyn .NET Analyzers for powerful and customizable code analysis
- Defaults suited to the organization's coding practices
- Ensures code compliance and maintainability

## Installation
To install this package, use the NuGet Package Manager Console:

```shell
PM> Install-Package Escendit.Tools.CodeAnalysis.SonarAnalyzers
```
Or you can search for "Escendit.Tools.CodeAnalysis.SonarAnalyzers"
in the NuGet Package Manager UI and install it from there.

## Usage
After installing the package, the MSBuild and .editorconfig properties will be set automatically.
- You can modify the MSBuild properties by updating the values in your .csproj or .vbproj file.
- You can modify the .editorconfig properties by creating .editorconfig file and overriding the default values.

## Configuration

The NuGet package includes the following default rules and severity levels:

Currently, vendor provides the defaults.

To modify the severity level of a rule, you can add the following code to your .editorconfig file:

```editorconfig
dotnet_diagnostic.<Rule>.severity = <Severity>
```

For example, to change the severity level of `S9999` to "error", add the following line to your .editorconfig file:

```editorconfig
dotnet_diagnostic.S9999.severity = error
```


## Contributing
If you find a bug or have a feature request, please create an issue in the GitHub repository.

To contribute code, fork the repository and submit a pull request.
Please ensure that your code follows the project's coding standards and is thoroughly tested.

## License
This package is released under the MIT License. See the LICENSE.txt file for details.
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "7.0.100"
}
}
7 changes: 7 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DevelopmentDependency>true</DevelopmentDependency>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<Description>Enforce our coding practices in your projects with our NuGet package's default settings for Sonar Analyzers.</Description>
<PackageTags>analyzers;sonar;defaults</PackageTags>
</PropertyGroup>
<ItemGroup>
<!-- TFM -->
<None Pack="true" PackagePath="build" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.props" />
<None Pack="true" PackagePath="build" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.targets" />
<!-- TFMs -->
<None Pack="true" PackagePath="buildMultiTargeting" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.props" />
<None Pack="true" PackagePath="buildMultiTargeting" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.targets" />
<!-- Transitive -->
<None Pack="true" PackagePath="buildTransitive" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.props" />
<None Pack="true" PackagePath="buildTransitive" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.targets" />
<!-- Assets -->
<None Pack="true" PackagePath="" Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers.globalconfig" />
<!-- README -->
<None Pack="true" PackagePath="" Include="$(SolutionDir)/README.md" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.55.0.65544">
<PrivateAssets>runtime; build; native; contentfiles</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
is_global = true
global_level = -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<CodeAnalysisRuleSetLocation>$(NuGetPackageRoot)</CodeAnalysisRuleSetLocation>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<EditorConfigFiles Include="$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)\..\Escendit.Tools.CodeAnalysis.SonarAnalyzers.globalconfig'))">
<Link>Escendit.Tools.CodeAnalysis.SonarAnalyzers.globalconfig</Link>
<Visible>false</Visible>
</EditorConfigFiles>
</ItemGroup>
</Project>

0 comments on commit 2b5d764

Please sign in to comment.