Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# https://docs.codacy.com/repositories-configure/codacy-configuration-file/
# Codacy configuration for excluding files and folders from analysis
# https://docs.codacy.com/repositories-configure/codacy-configuration-file/#ignore-files
# Uses Java GLOB syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob

exclude_paths:
- ".github"
- ".vscode"
- ".gitignore"
- "LICENSE"
- "README.md"
- "**.sln"
- "**.csproj"
- "**.json"
- "**.yml"
- "**/*Program.cs"
- "**/Data/**"
- "**/Enums/**"
- "**/Mappings/**"
- "**/Migrations/**"
- "**/Models/**"
- "**/Properties/**"
- "**/Utilities/**"
- "**.Tests/**"
# Ignore all project-level metadata and documentation
- '.gitignore' # root Git ignore file
- 'LICENSE' # root license file
- 'README.md' # root readme

# Ignore all file types that shouldn't be analyzed
- '**.yml' # YAML files anywhere (build, config, pipelines)
- '**.json' # JSON files (settings, config)
- '**.png' # Images, e.g., Swagger diagram
- '**.sln' # Solution files
- '**.csproj' # C# project files

# Ignore generated or infrastructure files
- '**/*Program.cs' # Main entry point, often not useful for static analysis

# Ignore specific folders across any depth in the project
- '**/Data/**' # Repositories, DbContext, database file, etc.
- '**/Enums/**' # Enumeration types
- '**/Mappings/**' # AutoMapper profiles
- '**/Migrations/**' # EF Core migration snapshots
- '**/Models/**' # Domain and DTO models
- '**/Properties/**' # launchSettings.json or AssemblyInfo.cs
- '**/Utilities/**' # Helper extensions or static classes
- '**/test/**' # Entire test suite (unit + integration)
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
# Use cache-dependency-path for cases when multiple dependency files
# are used, or they are located in different subdirectories.
cache-dependency-path: |
Dotnet.Samples.AspNetCore.WebApi/packages.lock.json
Dotnet.Samples.AspNetCore.WebApi.Tests/packages.lock.json
src/Dotnet.Samples.AspNetCore.WebApi/packages.lock.json
test/Dotnet.Samples.AspNetCore.WebApi.Tests/packages.lock.json

- name: Restore dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Dotnet.Samples.AspNetCore.WebApi/bin/Debug/net8.0/Dotnet.Samples.AspNetCore.WebApi.dll",
"program": "${workspaceFolder}/src/Dotnet.Samples.AspNetCore.WebApi/bin/Debug/net8.0/Dotnet.Samples.AspNetCore.WebApi.dll",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+https://localhost:([0-9]+)",
Expand Down
Binary file removed Dotnet.Samples.AspNetCore.WebApi.Swagger.png
Binary file not shown.
67 changes: 36 additions & 31 deletions Dotnet.Samples.AspNetCore.WebApi.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dotnet.Samples.AspNetCore.WebApi", "Dotnet.Samples.AspNetCore.WebApi\Dotnet.Samples.AspNetCore.WebApi.csproj", "{5C9D575F-BA87-45E3-A809-A6A3FA8BACEC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dotnet.Samples.AspNetCore.WebApi.Tests", "Dotnet.Samples.AspNetCore.WebApi.Tests\Dotnet.Samples.AspNetCore.WebApi.Tests.csproj", "{EB141171-BC47-4EAB-BD5B-61B24E0B509D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5C9D575F-BA87-45E3-A809-A6A3FA8BACEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C9D575F-BA87-45E3-A809-A6A3FA8BACEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C9D575F-BA87-45E3-A809-A6A3FA8BACEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C9D575F-BA87-45E3-A809-A6A3FA8BACEC}.Release|Any CPU.Build.0 = Release|Any CPU
{EB141171-BC47-4EAB-BD5B-61B24E0B509D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB141171-BC47-4EAB-BD5B-61B24E0B509D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB141171-BC47-4EAB-BD5B-61B24E0B509D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB141171-BC47-4EAB-BD5B-61B24E0B509D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2B47AED3-6774-467B-92AE-6A3EAC9741BA}
EndGlobalSection
EndGlobal

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", "{6E3A447C-C7E3-4E1C-B70D-CE1C4E6B13E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dotnet.Samples.AspNetCore.WebApi", "src\Dotnet.Samples.AspNetCore.WebApi\Dotnet.Samples.AspNetCore.WebApi.csproj", "{1ED8A3DB-5092-4D79-ABA2-403797A6898C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0A2F456B-EF02-40FA-A529-E4DA81E545AB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dotnet.Samples.AspNetCore.WebApi.Tests", "test\Dotnet.Samples.AspNetCore.WebApi.Tests\Dotnet.Samples.AspNetCore.WebApi.Tests.csproj", "{F45E3AF3-F6A2-4494-AEF2-2A228D5E8F1E}"
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(ProjectConfigurationPlatforms) = postSolution
{1ED8A3DB-5092-4D79-ABA2-403797A6898C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ED8A3DB-5092-4D79-ABA2-403797A6898C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ED8A3DB-5092-4D79-ABA2-403797A6898C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ED8A3DB-5092-4D79-ABA2-403797A6898C}.Release|Any CPU.Build.0 = Release|Any CPU
{F45E3AF3-F6A2-4494-AEF2-2A228D5E8F1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F45E3AF3-F6A2-4494-AEF2-2A228D5E8F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F45E3AF3-F6A2-4494-AEF2-2A228D5E8F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F45E3AF3-F6A2-4494-AEF2-2A228D5E8F1E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1ED8A3DB-5092-4D79-ABA2-403797A6898C} = {6E3A447C-C7E3-4E1C-B70D-CE1C4E6B13E1}
{F45E3AF3-F6A2-4494-AEF2-2A228D5E8F1E} = {0A2F456B-EF02-40FA-A529-E4DA81E545AB}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Proof of Concept for a Web API made with [ASP.NET Core 8.0](https://learn.micros
## Start

```console
dotnet watch run --project Dotnet.Samples.AspNetCore.WebApi/Dotnet.Samples.AspNetCore.WebApi.csproj
dotnet watch run --project src/Dotnet.Samples.AspNetCore.WebApi/Dotnet.Samples.AspNetCore.WebApi.csproj
```

## Documentation
Expand All @@ -30,7 +30,7 @@ dotnet watch run --project Dotnet.Samples.AspNetCore.WebApi/Dotnet.Samples.AspNe
https://localhost:9000/swagger/index.html
```

![API Documentation](Dotnet.Samples.AspNetCore.WebApi.Swagger.png)
![API Documentation](/docs/Swagger.png)

## Credits

Expand Down
48 changes: 32 additions & 16 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

coverage:

#https://docs.codecov.com/docs/commit-status
# https://docs.codecov.com/docs/commit-status
status:
project:
default:
target: 80% # Default target for all components
threshold: 10% # Default threshold for all components
if_not_found: success # If no coverage report is found, the status will be success
if_ci_failed: error # If the CI failed, the status will be error
threshold: 10% # Allowable drop in coverage without failing
if_not_found: success # If no coverage report is found, don't fail
if_ci_failed: error # CI failure should fail coverage check

# Components inherit the default settings
# Components for focused coverage metrics
controllers:
paths:
- "Dotnet.Samples.AspNetCore.WebApi/Controllers/"
Expand All @@ -21,16 +21,32 @@ coverage:

patch:
default:
target: 80% # Default target for all components
threshold: 10% # Default threshold for all components
target: 80% # Target for changed lines
threshold: 10%

# https://docs.codecov.com/docs/ignoring-paths
ignore:
- "Dotnet.Samples.AspNetCore.WebApi/Data"
- "Dotnet.Samples.AspNetCore.WebApi/Enums"
- "Dotnet.Samples.AspNetCore.WebApi/Mappings"
- "Dotnet.Samples.AspNetCore.WebApi/Migrations"
- "Dotnet.Samples.AspNetCore.WebApi/Models"
- "Dotnet.Samples.AspNetCore.WebApi/Properties"
- "Dotnet.Samples.AspNetCore.WebApi/Utilities"
- "Dotnet.Samples.AspNetCore.WebApi/Program.cs"
- "Dotnet.Samples.AspNetCore.WebApi.Tests"
# Ignore common project metadata and config files
- '.*\.sln' # Solution files
- '.*\.csproj' # C# project files
- '.*\.json' # JSON config files (e.g., appsettings)
- '.*\.yml' # YAML config files (e.g., pipelines)
- '.*\.png' # Image assets (e.g., Swagger diagram)

# Ignore test project entirely
- '.*\/test\/.*' # Any file in the test folder (unit/integration/utils)

# Ignore infrastructure and support folders anywhere in the project
- '.*\/Data\/.*' # Repositories, DbContext, database files
- '.*\/Enums\/.*' # Enums like Position
- '.*\/Mappings\/.*' # AutoMapper profiles
- '.*\/Migrations\/.*' # EF Core migration artifacts
- '.*\/Models\/.*' # Domain and DTO models
- '.*\/Properties\/.*' # launchSettings.json or other system files
- '.*\/Utilities\/.*' # Static helper and extension classes

# Ignore application entry point and documentation files
- '.*\/Program\.cs' # ASP.NET Core entry point
- '.*\/\.gitignore' # Git ignore file
- '.*\/LICENSE' # License text
- '.*\/README\.md' # Project readme
Binary file added docs/Swagger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Dotnet.Samples.AspNetCore.WebApi\Dotnet.Samples.AspNetCore.WebApi.csproj" />
<ProjectReference Include="..\..\src\Dotnet.Samples.AspNetCore.WebApi\Dotnet.Samples.AspNetCore.WebApi.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading