[Feature Request]: Specify the .editorconfig path when incorrect value is specified
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### Summary
Current implementation of ConfigurationProvider and initiating instances of [BuildAnalyzerConfiguration](https://github.com/dotnet/msbuild/blob/main/src/Build/BuildCheck/API/BuildAnalyzerConfiguration.cs) could result exception and build error in case the configuration was provided incorrectly:
https://github.com/dotnet/msbuild/blob/main/src/Build/BuildCheck/API/BuildAnalyzerConfiguration.cs#L95-L100
```C#
private static void ThrowIncorrectValueException(string key, string value)
{
// TODO: It will be nice to have the filename where the incorrect configuration was placed.
throw new BuildCheckConfigurationException(
$"Incorrect value provided in config for key {key}: '{value}'",
buildCheckConfigurationErrorScope: BuildCheckConfigurationErrorScope.EditorConfigParser);
```
The exception shows only incorrect value, however there is no information on which file was used for this specific value.
### Background and Motivation
In case there are multiple upper directories with editorconfig containing incorrect values it not clear from which exactly was incorrect value was used and resulted build to fail
### Proposed Feature
Include the full path of `.editorconfig` from where the incorrect value was parsed.
The change will require updating the current parsing logic and have additional information per the option with the file information from where it was fetched (increases the usage of memory)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.