Skip to content

Commit 69db309

Browse files
committed
adds qodana code quality workflow
Adds a Qodana workflow to analyze code quality. Configures the workflow with .NET SDK setup, Qodana scan execution, and inspection profiles.
1 parent 4f2ca1e commit 69db309

File tree

4 files changed

+129
-0
lines changed

4 files changed

+129
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Qodana
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
- 'fix/*'
8+
- 'feature/*'
9+
jobs:
10+
qodana:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
checks: write
16+
steps:
17+
-
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
fetch-depth: 0
22+
-
23+
name: Setup .NET SDK
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
global-json-file: global.json
27+
-
28+
name: 'Qodana Scan'
29+
uses: jetbrains/[email protected]
30+
with:
31+
cache-default-branch-only: true
32+
pr-mode: true
33+
env:
34+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

build/CI.slnx

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<File Path="../.gitignore" />
2929
<File Path="../.remarkrc.yaml" />
3030
<File Path="../global.json" />
31+
<File Path="../qodana.yaml" />
3132
<File Path="../package.json" />
3233
<File Path="../src/mark-shipped.ps1" />
3334
<File Path="Directory.Build.props" />
@@ -44,6 +45,7 @@
4445
<File Path="../.github/workflows/release.yml" />
4546
<File Path="../.github/workflows/stale.yml" />
4647
<File Path="../.github/workflows/winget.yml" />
48+
<File Path="../.github/workflows/qodana_code_quality.yml" />
4749
</Folder>
4850
<Folder Name="/workflows/_/">
4951
<File Path="../.github/workflows/_artifacts_linux.yml" />

qodana.yaml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#-------------------------------------------------------------------------------#
2+
# Qodana analysis is configured by qodana.yaml file #
3+
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
4+
#-------------------------------------------------------------------------------#
5+
version: "1.0"
6+
#Specify IDE code to run analysis without container (Applied in CI/CD pipeline)
7+
ide: QDNET
8+
#Specify inspection profile for code analysis
9+
profile:
10+
name: qodana.starter
11+
include:
12+
- name: ConvertIfStatementToReturnStatement
13+
- name: ConvertIfStatementToConditionalTernaryExpression
14+
- name: AutoPropertyCanBeMadeGetOnly.Global
15+
- name: CanReplaceCastWithLambdaReturnType
16+
- name: ChangeFieldTypeToSystemThreadingLock
17+
- name: ConvertIfStatementToSwitchStatement
18+
- name: ConvertToConstant.Local
19+
- name: DuplicatedSequentialIfBodies
20+
- name: InlineTemporaryVariable
21+
- name: InvertIf
22+
- name: UseVerbatimString
23+
- name: MemberCanBePrivate.Global
24+
- name: MemberCanBeProtected.Global
25+
- name: MergeIntoPattern
26+
- name: UnusedMethodReturnValue.Global
27+
- name: EditorConfigNoMatchingFiles
28+
- name: PreferConcreteValueOverDefault
29+
- name: PropertyCanBeMadeInitOnly.Global
30+
- name: MoveLocalFunctionAfterJumpStatement
31+
- name: RedundantExplicitParamsArrayCreation
32+
- name: RedundantOverload.Global
33+
- name: RedundantStringInterpolation
34+
- name: RedundantVerbatimStringPrefix
35+
- name: ReplaceSubstringWithRangeIndexer
36+
- name: RCS1001
37+
- name: RCS1003
38+
- name: RCS1123
39+
- name: SYSLIB1045
40+
- name: CA1826
41+
- name: RCS1256
42+
- name: RCS1118
43+
- name: RCS1077
44+
- name: RCS1205
45+
- name: RCS1214
46+
- name: RCS1249
47+
- name: RCS1192
48+
- name: SYSLIB1054
49+
- name: CA1512
50+
- name: CA1866
51+
- name: CA1859
52+
- name: RCS1246
53+
- name: CA1829
54+
- name: RCS1266
55+
- name: RCS1267
56+
- name: RCS1227
57+
- name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault
58+
- name: SwitchStatementHandlesSomeKnownEnumValuesWithDefault
59+
- name: RedundantAlwaysMatchSubpattern
60+
- name: UnusedType.Global
61+
- name: UnusedMemberInSuper.Global
62+
- name: UnusedMember.Local
63+
- name: EditorConfigKeyCorrectness
64+
- name: UseCollectionCountProperty
65+
- name: UseDiscardAssignment
66+
- name: ArrangeNamespaceBody
67+
- name: SuggestDiscardDeclarationVarStyle
68+
- name: ArrangeTrailingCommaInMultilineLists
69+
- name: ArrangeObjectCreationWhenTypeNotEvident
70+
- name: UseRawString
71+
- name: VirtualMemberNeverOverridden.Global
72+
- name: ArrangeVarKeywordsInDeconstructingDeclaration
73+
- name: SuggestVarOrType_BuiltInTypes
74+
#Enable inspections
75+
#include:
76+
# - name: <SomeEnabledInspectionId>
77+
#Disable inspections
78+
exclude:
79+
- name: LoopCanBeConvertedToQuery
80+
- name: ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
81+
- name: ConvertIfStatementToConditionalTernaryExpression
82+
paths:
83+
- GitVersion.Core.Tests/IntegrationTests/AlignGitFlowWithMainlineVersionStrategy.cs
84+
- GitVersion.Core.Tests/IntegrationTests/AlignGitHubFlowWithMainlineVersionStrategy.cs
85+
#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
86+
bootstrap: dotnet build src/GitVersion.slnx
87+
dotnet:
88+
frameworks: net8.0;net9.0
89+
solution: src/GitVersion.slnx
90+
#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
91+
#plugins:
92+
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)

src/GitVersion.slnx

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<File Path="../.gitversion.yml" />
1616
<File Path="../GitReleaseManager.yml" />
1717
<File Path="../global.json" />
18+
<File Path="../qodana.yaml" />
1819
</Folder>
1920
<Folder Name="/root/readme/">
2021
<File Path="../BREAKING_CHANGES.md" />

0 commit comments

Comments
 (0)