Execute .NET code analyzers in CI #33

Merged
PavelGrossSpb merged 1 commit from potyarkin/frostfs-sdk-csharp:feature/ci-linter into master 2024-11-18 07:07:58 +00:00
Member

.NET SDK comes with many builtin static analyzers: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-8

We have configured these analyzers previously, now we can add them to our CI.

Needs input from reviewers:

  • I've checked that switching some warnings to errors in .editorconfig produces the expected result. This means the linters are actually executed as part of dotnet build
  • But I'm a foreigner in dotnet land and I'm not sure if ALL the linters are executed or how to even check that? I've noticed that we don't use EnforceCodeStyleInBuild which is described as required in docs, hence this question.
  • I've also noticed that we don't EnableNETAnalyzers for FrostFS.SDK.Tests. Is that intentional?
.NET SDK comes with many builtin static analyzers: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-8 We have configured these analyzers [previously](https://git.frostfs.info/TrueCloudLab/frostfs-sdk-csharp/pulls/30), now we can add them to our CI. Needs input from reviewers: - I've checked that switching some warnings to errors in `.editorconfig` produces the expected result. This means the linters are actually executed as part of `dotnet build` - But I'm a foreigner in dotnet land and I'm not sure if ALL the linters are executed or how to even check that? I've noticed that we don't use `EnforceCodeStyleInBuild` which is described as required [in docs](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-9#enable-on-build), hence this question. - I've also noticed that we don't `EnableNETAnalyzers` for FrostFS.SDK.Tests. Is that intentional?
potyarkin added 1 commit 2024-11-13 09:13:00 +00:00
[#13] Execute .NET code analyzers in CI
All checks were successful
DCO / DCO (pull_request) Successful in 1m7s
lint-build / dotnet8.0 (pull_request) Successful in 1m50s
82c7aab876
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
potyarkin changed title from WIP: Execute .NET code analyzers in CI to Execute .NET code analyzers in CI 2024-11-13 09:35:16 +00:00
potyarkin requested review from dstepanov-yadro 2024-11-13 09:35:38 +00:00
potyarkin requested review from orikik 2024-11-13 09:35:39 +00:00
potyarkin requested review from PavelGrossSpb 2024-11-13 09:35:39 +00:00
Member

I'll add EnforceCodeStyleInBuild to the projects and turn on analizers for test projects.

I'll add `EnforceCodeStyleInBuild` to the projects and turn on analizers for test projects.
PavelGrossSpb approved these changes 2024-11-13 20:21:02 +00:00
orikik approved these changes 2024-11-15 08:03:39 +00:00
dstepanov-yadro approved these changes 2024-11-15 13:25:42 +00:00
PavelGrossSpb merged commit c406df1a78 into master 2024-11-18 07:07:58 +00:00
Sign in to join this conversation.
No description provided.