Skip to content

Commit

Permalink
Merge branch 'main' into gitauto/issue-432-16721fcb-adbc-4cf7-b867-79…
Browse files Browse the repository at this point in the history
…084d256b2c
  • Loading branch information
guibranco authored Dec 13, 2024
2 parents 5e23ecd + 299be3c commit 563434c
Show file tree
Hide file tree
Showing 203 changed files with 14,513 additions and 15,444 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.29.2",
"version": "0.30.3",
"commands": [
"dotnet-csharpier"
]
Expand Down
7 changes: 6 additions & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
version = 1

test_patterns = [
"Tests/**"
]

[[analyzers]]
name = "csharp"

[[analyzers]]
name = "secrets"

[[analyzers]]
name = "test-coverage"
name = "test-coverage"

39 changes: 39 additions & 0 deletions .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

# This script generates an AI-powered commit message using dotnet-aicommitmessage.
# It can be bypassed by setting the GIT_AICOMMIT_SKIP environment variable.

# Exit immediately if GIT_AICOMMIT_SKIP is set
if [ -n "$GIT_AICOMMIT_SKIP" ]; then
exit 0
fi

if ! command -v dotnet-aicommitmessage &> /dev/null; then
echo "Error: dotnet-aicommitmessage is not installed or not in PATH" >&2
echo "Please install it by running 'dotnet tool install -g aicommitmessage'" >&2
exit 1
fi

COMMIT_MSG_FILE=$1
CURRENT_MESSAGE=$(cat "$COMMIT_MSG_FILE")

# From version 0.6.1, this is not needed anymore.
# GIT_DIFF=$(git diff --staged)
# GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)

# Run dotnet-aicommitmessage with error handling
# From version 0.6.1 branch and diff are now retrieved by the tool and don't need to be passed manually.
# Version 0.6.1 and higher: dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE"
# Version 0.6.0 and lower: dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE" -b "$GIT_BRANCH_NAME" -d "$GIT_DIFF"

if ! AI_MESSAGE=$(dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE"); then
echo "Error: Failed to generate AI commit message. Using original message." >&2
exit 0
fi

if [[ -z "$AI_MESSAGE" || "$AI_MESSAGE" =~ ^[[:space:]]*$ ]]; then
echo "Error: Generated commit message is empty." >&2
exit 1
fi
echo "$AI_MESSAGE" > "$COMMIT_MSG_FILE"
exit 0
45 changes: 45 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "CodeQL"

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "36 2 * * 2"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["csharp"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "security"
4 changes: 2 additions & 2 deletions .github/workflows/deep-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.x'

- name: Build and analyze
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: |
dotnet build -c Debug --verbosity minimal
dotnet test -c Debug --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura"
./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/CrispyWaffle.Tests/coverage.net8.0.cobertura.xml
./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/CrispyWaffle.Tests/coverage.net9.0.cobertura.xml
27 changes: 27 additions & 0 deletions .github/workflows/infersharp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: InferSharp Analysis

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
analyze:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run InferSharp
uses: microsoft/[email protected]

- name: Upload SARIF results
if: success() && steps.infersharp.outputs.sarif-report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.infersharp.outputs.sarif-report }}
continue-on-error: true
2 changes: 1 addition & 1 deletion .github/workflows/infisical-secrets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
fetch-depth: 0

- name: Infisical secrets check
uses: guibranco/[email protected].13
uses: guibranco/[email protected].21
6 changes: 1 addition & 5 deletions .github/workflows/size-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Label based on PR size

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
Expand All @@ -17,12 +16,9 @@ jobs:
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
) || (
github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository
) || (
github.event_name == 'workflow_dispatch'
)
uses: "pascalgn/[email protected].4"
uses: "pascalgn/[email protected].5"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
9 changes: 7 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- name: Docker compose up
run: docker compose up -d && sleep 10

Expand Down Expand Up @@ -58,7 +63,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
~/.sonar/cache/dotnet-sonarscanner begin /k:"${{ env.KEY }}" /o:"${{ env.ORG }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
~/.sonar/cache/dotnet-sonarscanner begin /k:"${{ env.KEY }}" /o:"${{ env.ORG }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.scanner.scanAll=false /d:sonar.cs.opencover.reportsPaths="Tests/**/coverage.net9.0.opencover.xml"
dotnet build -c Release --verbosity minimal
dotnet test -c Release --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura"
dotnet test -c Release --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="opencover"
~/.sonar/cache/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
25 changes: 0 additions & 25 deletions CONTRIBUTING.md

This file was deleted.

5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup Label="SDK Versions">
<DotNetVersions>netstandard2.0;netstandard2.1;net6.0;net8.0</DotNetVersions>
<DotNetVersionTests>net8.0</DotNetVersionTests>
<DotNetVersions>netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0</DotNetVersions>
<DotNetVersionTests>net9.0</DotNetVersionTests>
</PropertyGroup>

<PropertyGroup Label="NuGet package">
Expand Down Expand Up @@ -36,6 +36,7 @@
<ImplicitUsings>disabled</ImplicitUsings>
<Nullable>disable</Nullable>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<RestorePackagesWithLockFile>false</RestorePackagesWithLockFile>
<NoWarn>$(NoWarn);1591;NU5105;SA1633;CA1711</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
19 changes: 9 additions & 10 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.15.10" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.16.3" />
<PackageVersion Include="ElmahCore" Version="2.1.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="JunitXml.TestLogger" Version="4.1.0" />
<PackageVersion Include="log4net" Version="3.0.1" />
<PackageVersion Include="log4net" Version="3.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="NEST" Version="7.17.5" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="RabbitMQ.Client" Version="6.8.1" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.16" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.3.0.106239" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.22" />
<PackageVersion Include="StackExchange.Redis.Extensions.Core" Version="9.1.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageVersion Include="System.Diagnostics.EventLog" Version="8.0.1" />
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.0" />
<PackageVersion Include="System.Security.Permissions" Version="[6.0.0,7.0.0)" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
Expand Down
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# YAML Serialization Support

This project now supports YAML serialization and deserialization using the `YamlSerializer` class.

## Usage

```csharp
var serializer = new YamlSerializer();
var yaml = serializer.Serialize(new { Name = "Test", Value = 123 });
var obj = serializer.Deserialize<dynamic>(yaml);
# Crispy Waffle

🧰 🛠️ Crispy Waffle project - a toolkit for .NET projects.
Expand Down Expand Up @@ -77,9 +67,10 @@ As of August 2024, this toolkit is currently published in the following `.NET` v
- .NET Standard 2.1
- .NET 6.0
- .NET 8.0
- .NET -.0

This is an official Microsoft [.NET-supported versions](https://dotnet.microsoft.com/en-us/platform/dotnet-standard) table based on the lowest target version (.NET Standard 2.0):
![Supported version as of Aug/2024](docs/images/supported-versions-2024-08.png)
![Supported version as of Aug/2024](https://raw.githubusercontent.com/guibranco/CrispyWaffle/main/docs/images/supported-versions-2024-08.png)

---

Expand Down Expand Up @@ -262,26 +253,26 @@ Refer to [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to contribute to this p
</a>
</td>
<td align="center">
<a href="https://github.com/stack-file[bot]">
<img src="https://avatars.githubusercontent.com/in/408123?v=4" width="100;" alt="stack-file[bot]"/>
<a href="https://github.com/gitauto-ai[bot]">
<img src="https://avatars.githubusercontent.com/in/844909?v=4" width="100;" alt="gitauto-ai[bot]"/>
<br />
<sub><b>stack-file[bot]</b></sub>
<sub><b>gitauto-ai[bot]</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/codefactor-io[bot]">
<img src="https://avatars.githubusercontent.com/in/25603?v=4" width="100;" alt="codefactor-io[bot]"/>
<a href="https://github.com/stack-file[bot]">
<img src="https://avatars.githubusercontent.com/in/408123?v=4" width="100;" alt="stack-file[bot]"/>
<br />
<sub><b>codefactor-io[bot]</b></sub>
<sub><b>stack-file[bot]</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/gitauto-ai[bot]">
<img src="https://avatars.githubusercontent.com/in/844909?v=4" width="100;" alt="gitauto-ai[bot]"/>
<a href="https://github.com/codefactor-io[bot]">
<img src="https://avatars.githubusercontent.com/in/25603?v=4" width="100;" alt="codefactor-io[bot]"/>
<br />
<sub><b>gitauto-ai[bot]</b></sub>
<sub><b>codefactor-io[bot]</b></sub>
</a>
</td>
<td align="center">
Expand Down
Loading

0 comments on commit 563434c

Please sign in to comment.