From 4c7a0657316574662b41fbe3f5f9e9dd0e7a0ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Hellander?= Date: Sun, 20 Jul 2025 14:12:45 +0200 Subject: [PATCH] Updated SettingsHelper to not throw exception if the settings file can not be read #3902 --- .../StyleCop.Analyzers/Settings/SettingsHelper.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Settings/SettingsHelper.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Settings/SettingsHelper.cs index f00a9e608..e306d6607 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/Settings/SettingsHelper.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Settings/SettingsHelper.cs @@ -275,8 +275,18 @@ private static SettingsFile GetSettingsFile(AnalyzerOptions options, Func(() => throw new InvalidSettingsException( + $"Settings file at '{additionalFile.Path}' could not be read")); + return new SettingsFile(additionalFile.Path, content); + } } }