Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit 2c83cab

Browse files
committed
Improved project organization
1 parent eeca635 commit 2c83cab

File tree

13 files changed

+253
-63
lines changed

13 files changed

+253
-63
lines changed

.editorconfig

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,20 @@ insert_final_newline = false
2222
charset = utf-8
2323

2424

25-
2625
# XML project files
2726
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
2827
indent_size = 2
2928

30-
29+
# Yaml files
30+
[*.{yaml,yml}]
31+
indent_size = 2
3132

3233

3334
# Config files
3435
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,json}]
3536
indent_size = 2
3637

3738

38-
39-
4039
# Code files
4140
[*.{cs,csx,vb,vbx}]
4241
indent_size = 4
@@ -429,9 +428,6 @@ dotnet_diagnostic.CA1848.severity = none
429428
# CA2254: Template should be a static expression
430429
dotnet_diagnostic.CA2254.severity = none
431430

432-
# CA2208: Instantiate argument exceptions correctly - https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2208
433-
dotnet_diagnostic.CA2208.severity = none # Occurs when we use string interpolation in message. E.g. new ArgumentNullException(nameof(Name), $"The {nameof(Name)} cannot be null");
434-
435431

436432

437433

.github/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2
2+
updates:
3+
4+
# Maintain dependencies for GitHub Actions
5+
- package-ecosystem: "github-actions"
6+
directory: "/" # Location of package manifests
7+
schedule:
8+
interval: "daily"
9+
assignees:
10+
- "NelsonBN"
11+
reviewers:
12+
- "NelsonBN"
13+
commit-message:
14+
prefix: "GitHubActions"
15+
include: "scope"
16+
target-branch: "develop"
17+
18+
# Nuget packages
19+
- package-ecosystem: "nuget"
20+
directory: "/" # Location of package manifests
21+
schedule:
22+
interval: "daily"
23+
assignees:
24+
- "NelsonBN"
25+
reviewers:
26+
- "NelsonBN"
27+
commit-message:
28+
prefix: "NuGet"
29+
include: "scope"
30+
target-branch: "develop"
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
name: CI/CD
1+
name: 'Publish Nuget'
22

33
on:
44
push:
55
branches:
66
- main
77

8+
89
jobs:
9-
build-and-deploy:
10+
11+
deploy-nuget:
12+
name: "Deploy NuGet"
1013
runs-on: ubuntu-latest
1114

1215
steps:
1316
- uses: actions/checkout@main
1417

15-
- name: Set up .NET Core
18+
- name: Setup .NET
1619
uses: actions/setup-dotnet@v1
1720
with:
1821
dotnet-version: '6.0.200'
1922

20-
- name: Build with dotnet
21-
run: dotnet build --configuration Release
23+
- name: Restore dependencies
24+
run: dotnet restore
2225

23-
- name: Test
24-
run: dotnet test
26+
- name: Build
27+
run: dotnet build --configuration Release
2528

2629
- name: Create the Package
2730
run: dotnet pack --configuration Release
2831

2932
- name: Publish
30-
run: dotnet nuget push "./src/bin/PowerUtils.Net.Primitives.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json
33+
run: dotnet nuget push "./src/bin/PowerUtils.Net.Primitives.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json

.github/workflows/sonarcloud.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: 'SonarCloud'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
branches:
10+
- main
11+
12+
13+
jobs:
14+
15+
sonar-scanner:
16+
name: "Sonar scanner"
17+
runs-on: windows-latest
18+
steps:
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: '6.0.200'
24+
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v1
27+
with:
28+
java-version: 1.11
29+
30+
- uses: actions/checkout@v2
31+
with:
32+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
33+
34+
- name: Cache SonarCloud packages
35+
uses: actions/cache@v2.1.7
36+
with:
37+
path: ~\sonar\cache
38+
key: ${{ runner.os }}-sonar
39+
restore-keys: ${{ runner.os }}-sonar
40+
41+
- name: Cache SonarCloud scanner
42+
id: cache-sonar-scanner
43+
uses: actions/cache@v2.1.7
44+
with:
45+
path: .\.sonar\scanner
46+
key: ${{ runner.os }}-sonar-scanner
47+
restore-keys: ${{ runner.os }}-sonar-scanner
48+
49+
- name: Install SonarCloud scanner
50+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
51+
shell: pwsh
52+
run: |
53+
New-Item -Path .\.sonar\scanner -ItemType Directory
54+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
55+
56+
- name: Build and analyze
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
59+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
60+
shell: pwsh
61+
run: |
62+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}" /o:"${{ secrets.SONAR_ORGANIZATION }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
63+
dotnet build --configuration Release
64+
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
65+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

.github/workflows/test-project.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 'Tests'
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
branches:
10+
- main
11+
12+
13+
jobs:
14+
15+
test-project:
16+
name: "Testing project"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: '6.0.200'
26+
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build --no-restore
32+
33+
- name: Test
34+
run: dotnet test --no-build

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,13 @@ $RECYCLE.BIN/
447447
##
448448
## Visual Studio Code
449449
##
450+
.vscode
450451
.vscode/*
451452
!.vscode/settings.json
452453
!.vscode/tasks.json
453454
!.vscode/launch.json
454455
!.vscode/extensions.json
455-
.vscode
456+
457+
## Sonar
458+
.sonarqube
459+
sonarscan.bat

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
4+
5+
6+
## [1.1.0] - 2022-02-25
7+
[Full Changelog](https://github.com/TechNobre/PowerUtils.Net.Primitives/compare/v1.0.0...v1.1.0)
8+
9+
10+
### New Features
11+
12+
- Added constant for Status Code UNPROCESSABLE ENTITY 422;
13+
14+
15+
### Enhancements
16+
17+
- Updated documentation;
18+
19+
20+
21+
22+
## [1.0.0] - 2021-11-21
23+
24+
- Start project

PowerUtils.Net.Primitives.sln

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,31 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{BECA00C2-6FEE-416B-BF8A-DFBFC067ED21}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1.project", "1.project", "{BECA00C2-6FEE-416B-BF8A-DFBFC067ED21}"
77
ProjectSection(SolutionItems) = preProject
88
.editorconfig = .editorconfig
99
.gitignore = .gitignore
10+
CHANGELOG.md = CHANGELOG.md
1011
global.json = global.json
1112
LICENSE = LICENSE
12-
.github\workflows\main.yml = .github\workflows\main.yml
1313
README.md = README.md
1414
EndProjectSection
1515
EndProject
1616
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1.PowerUtils.Net.Primitives", "src\1.PowerUtils.Net.Primitives.csproj", "{A3649905-3DE7-4BBA-BC5D-1D62089C7FFD}"
1717
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2.PowerUtils.Net.Primitives.Tests", "tests\2.PowerUtils.Net.Primitives.Tests.csproj", "{EACB7A09-1067-4312-B8D1-1D29897BA8D4}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2.PowerUtils.Net.Primitives.Tests", "tests\PowerUtils.Net.Primitives.Tests\2.PowerUtils.Net.Primitives.Tests.csproj", "{EACB7A09-1067-4312-B8D1-1D29897BA8D4}"
19+
EndProject
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.cicd", "2.cicd", "{2ED72909-1EFA-41DE-9E9A-BD15DB2A396B}"
21+
ProjectSection(SolutionItems) = preProject
22+
dependabot.yml = dependabot.yml
23+
publish-nuget.yml = publish-nuget.yml
24+
sonarcloud.yml = sonarcloud.yml
25+
test-project.yml = test-project.yml
26+
EndProjectSection
27+
EndProject
28+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.src", "3.src", "{6F5B2D55-69F7-43F7-8BA8-97BB4D79276D}"
29+
EndProject
30+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.tests", "4.tests", "{3B90E664-51A0-4997-B2F3-58E2931E3B03}"
1931
EndProject
2032
Global
2133
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -35,6 +47,10 @@ Global
3547
GlobalSection(SolutionProperties) = preSolution
3648
HideSolutionNode = FALSE
3749
EndGlobalSection
50+
GlobalSection(NestedProjects) = preSolution
51+
{A3649905-3DE7-4BBA-BC5D-1D62089C7FFD} = {6F5B2D55-69F7-43F7-8BA8-97BB4D79276D}
52+
{EACB7A09-1067-4312-B8D1-1D29897BA8D4} = {3B90E664-51A0-4997-B2F3-58E2931E3B03}
53+
EndGlobalSection
3854
GlobalSection(ExtensibilityGlobals) = postSolution
3955
SolutionGuid = {A48BE987-BAA5-4255-862F-32B60FD428A9}
4056
EndGlobalSection

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# PowerUtils.Net.Primitives
22
Provides additional types and constants for network-based libraries.
33

4-
![CI](https://github.com/TechNobre/PowerUtils.Net.Primitives/actions/workflows/main.yml/badge.svg)
4+
![Tests](https://github.com/TechNobre/PowerUtils.Net.Primitives/actions/workflows/test-project.yml/badge.svg)
5+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Net.Primitives&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Net.Primitives)
6+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Net.Primitives&metric=coverage)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Net.Primitives)
7+
58
[![NuGet](https://img.shields.io/nuget/v/PowerUtils.Net.Primitives.svg)](https://www.nuget.org/packages/PowerUtils.Net.Primitives)
69
[![Nuget](https://img.shields.io/nuget/dt/PowerUtils.Net.Primitives.svg)](https://www.nuget.org/packages/PowerUtils.Net.Primitives)
710
[![License: MIT](https://img.shields.io/github/license/ofpinewood/http-exceptions.svg)](https://github.com/TechNobre/PowerUtils.Net.Primitives/blob/main/LICENSE)
@@ -69,6 +72,7 @@ dotnet add package PowerUtils.Net.Primitives
6972
- `StatusCodeLink.UNSUPPORTED_MEDIA_TYPE`;
7073
- `StatusCodeLink.REQUESTED_RANGE_NOT_SATISFIABLE`;
7174
- `StatusCodeLink.EXPECTATION_FAILED`;
75+
- `StatusCodeLink.UNPROCESSABLE_ENTITY`;
7276
- `StatusCodeLink.UPGRADE_REQUIRED`;
7377
- `StatusCodeLink.INTERNAL_SERVER_ERROR`;
7478
- `StatusCodeLink.NOT_IMPLEMENTED`;
@@ -97,14 +101,6 @@ dotnet add package PowerUtils.Net.Primitives
97101

98102

99103

100-
## Release Notes
101-
102-
103-
### v1.0.1 - ???
104-
105-
#### Enhancements
106-
- Updated documentation;
107-
104+
## Changelog
108105

109-
### v1.0.0 - 2021/11/21
110-
- Kick start project
106+
[Here](./CHANGELOG.md)

src/1.PowerUtils.Net.Primitives.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
<PackageId>PowerUtils.Net.Primitives</PackageId>
1414
<title>PowerUtils.Net.Primitives</title>
1515
<Product>PowerUtils.Net.Primitives</Product>
16-
<Version>1.0.0</Version>
16+
<Version>1.1.0</Version>
1717

1818
<Authors>Nelson Nobre</Authors>
1919
<Company>TechNobre</Company>
2020

2121
<License>MIT</License>
2222
<PackageLicenseFile>LICENSE</PackageLicenseFile>
23-
<Copyright>Copyright © 2021 by TechNobre</Copyright>
23+
<Copyright>Copyright © 2022 by TechNobre</Copyright>
2424

2525
<Description>Provides additional types and constants for network-based libraries.</Description>
2626
<PackageReleaseNotes>
27-
- Updated documentation;
27+
- Added constant for Status Code UNPROCESSABLE ENTITY 422
2828
</PackageReleaseNotes>
2929
<Description>Provides additional types and constants for network-based libraries.</Description>
3030
<PackageTags>PowerUtils;Utils;Net;Primitives;Types;Constants;Web</PackageTags>

0 commit comments

Comments
 (0)