Skip to content

Commit 4dfc5f0

Browse files
lsolanoLorenzo Solano Martinez
andauthored
Closes #12 , #16 , and #30 (#29)
* #12 #16 Initial commit. * #12 #16 Re arrange package properties and add snupkg symbols format. * #30 chore-😒: Declare new desing on README.md and version bump 1. Declare new desing on README.md 2. Version bump (3.x to 4.0.0-alpha) 3. Add net6.0 target framework. * #30 feat-⭐️!: Mass changes renames, new opts, del 1. Remove deprecated methods 2. Rename multiple methods 3. Split methods with optional messages (overloads) in two with more explicit names. BREAKING CHANGE: Remove deprecated methods from Arguments * #30 style-🌈: Reduce code samples indent on README * SDK and Language version bump * Upgrading actions * Upgrading actions * Refreshing Sonar config * Fixing build * Build setup * Solving Sonar issues and using GeneratedRegex * Fix Sonar issues and refactor range checks * Update Quality Gate badge * Upgrading actions * Adding .editorconfig * Configuring code style * Resolving code style issues * Solving code-style issues * Solving code-style issues * Solving code-style issues * Solving code-style issues * Solving code-style issues * Update README.md * PR comments --------- Co-authored-by: Lorenzo Solano Martinez <[email protected]>
1 parent 8c8f242 commit 4dfc5f0

File tree

57 files changed

+1200
-1053
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1200
-1053
lines changed

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = false
12+
insert_final_newline = false
13+
14+
# Parentheses preferences
15+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
16+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
17+
dotnet_style_parentheses_in_other_operators = always_for_clarity
18+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
19+
20+
csharp_style_namespace_declarations = file_scoped
21+
22+
# Expression-bodied members
23+
csharp_style_expression_bodied_local_functions = true
24+
csharp_style_expression_bodied_methods = true

.github/workflows/build.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Analyse Code Quality
1+
name: Build and SonarQube
22
on:
33
push:
44
branches:
@@ -7,51 +7,50 @@ on:
77
types: [opened, synchronize, reopened]
88
jobs:
99
build:
10-
name: Build
10+
name: Build and analyze
1111
runs-on: windows-latest
1212
steps:
13-
- name: Set up JDK 11
14-
uses: actions/setup-java@v1
13+
- name: Set up JDK 17
14+
uses: actions/setup-java@v4
1515
with:
16-
java-version: 1.11
17-
- uses: actions/checkout@v2
16+
java-version: 17
17+
distribution: 'zulu' # Alternative distribution options are available.
18+
- uses: actions/checkout@v4
1819
with:
1920
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2021
- name: Setup .NET
21-
uses: actions/setup-dotnet@v1
22+
uses: actions/setup-dotnet@v4
2223
with:
23-
dotnet-version: 6.0.x
24-
include-prerelease: false
25-
- name: Cache SonarCloud packages
26-
uses: actions/cache@v1
24+
dotnet-version: 9.0.x
25+
dotnet-quality: preview
26+
- name: Cache SonarQube Cloud packages
27+
uses: actions/cache@v4
2728
with:
2829
path: ~\sonar\cache
2930
key: ${{ runner.os }}-sonar
3031
restore-keys: ${{ runner.os }}-sonar
31-
- name: Cache SonarCloud scanner
32+
- name: Cache SonarQube Cloud scanner
3233
id: cache-sonar-scanner
33-
uses: actions/cache@v1
34+
uses: actions/cache@v4
3435
with:
3536
path: .\.sonar\scanner
3637
key: ${{ runner.os }}-sonar-scanner
3738
restore-keys: ${{ runner.os }}-sonar-scanner
38-
- name: Install SonarCloud scanner
39+
- name: Install SonarQube Cloud scanner
3940
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
4041
shell: powershell
4142
run: |
4243
New-Item -Path .\.sonar\scanner -ItemType Directory
4344
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
4445
- name: Build and analyze
4546
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4747
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
48-
DOTNET_ROLL_FORWARD: Major
4948
shell: powershell
5049
run: |
5150
$workingDir=pwd
52-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"lsolano_triplex" /o:"lsolano" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.exclusions=tests/**,src/**/GlobalUsings.cs /d:sonar.cs.opencover.reportsPaths="$workingDir/test-results/coverage.net6.0.opencover.xml"
51+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"lsolano_triplex" /o:"lsolano" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.exclusions=tests/**,src/**/GlobalUsings.cs /d:sonar.cs.opencover.reportsPaths="$workingDir/test-results/coverage.net9.0.opencover.xml"
5352
if ("$GITHUB_REF" -ceq "refs/heads/master") {$configuration="Release"} else {$configuration="Debug"}
5453
dotnet clean -c "$configuration"
5554
dotnet build -c "$configuration"
56-
dotnet test --no-restore -c "$configuration" /p:CollectCoverage=true /p:CoverletOutputFormat=json%2copencover /p:MergeWith="$workingDir/test-results/coverage.json" /p:CoverletOutput="$workingDir/test-results/"
57-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
55+
dotnet test --no-restore -c "$configuration" /p:ExcludeByAttribute=GeneratedCode /p:CollectCoverage=true /p:CoverletOutputFormat=json%2copencover /p:MergeWith="$workingDir/test-results/coverage.json" /p:CoverletOutput="$workingDir/test-results/"
56+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

.github/workflows/dotnetcore.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@ jobs:
1818
language: [ 'csharp' ]
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222

2323
- name: Setup .NET Core
24-
uses: actions/setup-dotnet@v1
24+
uses: actions/setup-dotnet@v4
2525
with:
26-
dotnet-version: 6.0.100
26+
dotnet-version: 9.0.x
27+
dotnet-quality: preview
2728

2829
# Initializes the CodeQL tools for scanning.
2930
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v1
31+
uses: github/codeql-action/init@v3
3132
with:
3233
languages: ${{ matrix.language }}
3334

3435
- name: Build and run Unit Tests with dotnet
35-
run: dotnet test --framework net6.0 --configuration Release
36+
run: dotnet test --framework net9.0 --configuration Release
3637

3738
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@v1
39+
uses: github/codeql-action/analyze@v3

.github/workflows/nuget_push.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@ on:
77
- '1.*'
88
- '2.*'
99
- '3.*'
10+
- '4.*'
1011

1112
jobs:
1213
build:
1314

1415
runs-on: ubuntu-latest
1516

1617
steps:
17-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1819

1920
- name: Setup .NET
20-
uses: actions/setup-dotnet@v1
21+
uses: actions/setup-dotnet@v4
2122
with:
22-
dotnet-version: 6.0.x
23-
include-prerelease: false
23+
dotnet-version: 9.0.x
24+
dotnet-quality: preview
2425

2526
- name: Clean Last Build
26-
run: dotnet clean --framework net6.0 --configuration Release
27+
run: dotnet clean --framework net9.0 --configuration Release
2728

2829
- name: Clean old Packages
2930
run: rm --force src/Validations/bin/Release/Triplex.Validations*.nupkg
@@ -32,10 +33,10 @@ jobs:
3233
run: dotnet restore
3334

3435
- name: Build
35-
run: dotnet build --framework net6.0 --configuration Release
36+
run: dotnet build --framework net9.0 --configuration Release
3637

3738
- name: Test
38-
run: dotnet test --no-build --verbosity normal --framework net6.0 --configuration Release
39+
run: dotnet test --no-build --verbosity normal --framework net9.0 --configuration Release
3940

4041
- name: Package
4142
run: dotnet pack --configuration Release

.github/workflows/nuget_push_on_demand.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313

1414
- name: Setup .NET
15-
uses: actions/setup-dotnet@v1
15+
uses: actions/setup-dotnet@v4
1616
with:
17-
dotnet-version: 6.0.x
18-
include-prerelease: false
17+
dotnet-version: 9.0.x
18+
dotnet-quality: preview
1919

2020
- name: Clean Last Build
21-
run: dotnet clean --framework net6.0 --configuration Release
21+
run: dotnet clean --framework net9.0 --configuration Release
2222

2323
- name: Clean old Packages
2424
run: rm --force src/Validations/bin/Release/Triplex.Validations*.nupkg
@@ -27,10 +27,10 @@ jobs:
2727
run: dotnet restore
2828

2929
- name: Build
30-
run: dotnet build --framework net6.0 --configuration Release
30+
run: dotnet build --framework net9.0 --configuration Release
3131

3232
- name: Test
33-
run: dotnet test --no-build --verbosity normal --framework net6.0 --configuration Release
33+
run: dotnet test --no-build --verbosity normal --framework net9.0 --configuration Release
3434

3535
- name: Package
3636
run: dotnet pack --configuration Release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,4 @@ MigrationBackup/
357357
*.orig
358358

359359
coverage.*.json
360+
*.cobertura.xml

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@
77
"**/.project": true,
88
"**/.settings": true,
99
"**/.factorypath": true
10-
}
10+
},
11+
"cSpell.words": [
12+
"NETCOREAPP",
13+
"NETSTANDARD",
14+
"Parallelizable"
15+
]
1116
}

0 commit comments

Comments
 (0)