dotnet / dotnet/BenchmarkDotNet

Codify and standardize the console message for each Analyzer

Open
#2,057 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
11.5k
Forks
1.1k
Avg merge
6d 11h
Merged PRs (30d)
12

Description

We established Visual Studio Code tasks to run different groups of benchmarks, but we can't easily access the [analyzers](https://github.com/dotnet/BenchmarkDotNet/tree/master/src/BenchmarkDotNet/Analysers) printed in the console via the [Problems panel](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher
). It would be helpful to codify and standardize the console message for each analyzer.

For example, these messages cannot be easily matched:

```
Example.One: VeryLongRun -> The minimum observed iteration time is 1.4000 us which is very small. It's recommended to increase it to at least 100.0000 ms using more operations.
```

But these can!

```
.\source\Example.cs(10,10): warning BDN0001: The minimum observed iteration time is very small. [.\source\Example.csproj]
```

We could use the built-in [`$msCompile`](https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/tasks/common/problemMatcher.ts#L1208-L1216) problem matcher (see this [Regex101 example](https://regex101.com/r/CstiWM/1)). Each codified analyzer could be written up in more detail somewhere on the [website](https://benchmarkdotnet.org/articles/configs/analysers.html), like the other SDK analyzers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.