This repository was archived by the owner on Jul 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsonar-scanner.properties
More file actions
45 lines (31 loc) · 1.6 KB
/
sonar-scanner.properties
File metadata and controls
45 lines (31 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Please DO NOT set the following properties `sonar.organization` and `sonar.projectKey` in this file. They must be stored as `SONAR_ORGANISATION_KEY` and `SONAR_PROJECT_KEY` GitHub secrets.
sonar.host.url=https://sonarcloud.io
sonar.qualitygate.wait=true
sonar.sourceEncoding=UTF-8
# Code Coverage Configuration for .NET (C#)
#sonar.cs.opencover.reportsPaths=coverage.opencover.xml
# Sonar Server URL (Change if using SonarQube)
sonar.host.url=https://sonarcloud.io
# Set Node version
sonar.node.version=22.14.0
# Define the Source and Test Files
sonar.test.inclusions=**/*Tests.cs,**/*.test.cs
# Set the Language-Specific Sources (Ensures Proper Analysis)
sonar.language=cs,ts
# File Encoding
sonar.sourceEncoding=UTF-8
# Exclude Generated Code, Build Artifacts, and Unnecessary Files
sonar.exclusions=**/bin/**, **/obj/**, **/node_modules/**, **/wwwroot/**, **/dist/**, **/build/**, **/coverage/**
# Exclude Test Files from Main Analysis
sonar.test.exclusions=tests/**/*.cs, tests/**/*.ts, tests/**/*.tsx, tests/**/*.js
# Test Coverage for C# (Ensure Reports Are Generated Before Running SonarScanner)
sonar.cs.vscoveragexml.reportsPath=coverage/coverage.xml
# Test Coverage for TypeScript (Ensure Reports Are Generated Before Running SonarScanner)
sonar.javascript.lcov.reportPaths=coverage/lcov.info
# Enable TypeScript Analysis
sonar.typescript.file.suffixes=.ts,.tsx
# Enable C# Analysis
sonar.dotnet.key=SonarAnalyzer.CSharp
# Run C# Scanner (Requires Build Before Analysis)
sonar.dotnet.visualstudio.solution.file=ServiceLayer.sln
sonar.dotnet.build=false # Set to true if you want Sonar to build before scanning