Extended code analyzers (#293)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-02-25 19:58:17 +01:00
1 parent 99dac520cb
commit 5e3b632eee
22 files changed
+1099 -50

No files matched your search

@@ -2,15 +2,12 @@ namespace AIStudio.Assistants.ERI;
public static class AllowedLLMProvidersExtensions
{
public static string Description(this AllowedLLMProviders provider)
public static string Description(this AllowedLLMProviders provider) => provider switch
{
return provider switch
{
AllowedLLMProviders.NONE => "Please select what kind of LLM provider are allowed for this data source",
AllowedLLMProviders.ANY => "Any LLM provider is allowed: users might choose a cloud-based or a self-hosted provider",
AllowedLLMProviders.SELF_HOSTED => "Self-hosted LLM providers are allowed: users cannot choose any cloud-based provider",
_ => "Unknown option was selected"
};
}
AllowedLLMProviders.NONE => "Please select what kind of LLM provider are allowed for this data source",
AllowedLLMProviders.ANY => "Any LLM provider is allowed: users might choose a cloud-based or a self-hosted provider",
AllowedLLMProviders.SELF_HOSTED => "Self-hosted LLM providers are allowed: users cannot choose any cloud-based provider",
_ => "Unknown option was selected"
};
}
@@ -14,7 +14,7 @@ public partial class MudTextList : ComponentBase
public string Icon { get; set; } = Icons.Material.Filled.CheckCircle;
[Parameter]
public string Class { get; set; } = "";
public string Class { get; set; } = string.Empty;
private string Classes => $"mud-text-list {this.Class}";
}
-1
View File
@@ -13,7 +13,6 @@ internal static class Redirect
await nextHandler();
return;
}
#if DEBUG
@@ -10,15 +10,12 @@ public static class DataSourceTypeExtension
/// </summary>
/// <param name="type">The data source type.</param>
/// <returns>The display name of the data source type.</returns>
public static string GetDisplayName(this DataSourceType type)
public static string GetDisplayName(this DataSourceType type) => type switch
{
return type switch
{
DataSourceType.LOCAL_FILE => "Local File",
DataSourceType.LOCAL_DIRECTORY => "Local Directory",
DataSourceType.ERI_V1 => "External ERI Server (v1)",
_ => "None",
};
}
DataSourceType.LOCAL_FILE => "Local File",
DataSourceType.LOCAL_DIRECTORY => "Local Directory",
DataSourceType.ERI_V1 => "External ERI Server (v1)",
_ => "None",
};
}
@@ -2,15 +2,12 @@ namespace AIStudio.Settings.DataModel;
public static class ThemesExtensions
{
public static string GetName(this Themes theme)
public static string GetName(this Themes theme) => theme switch
{
return theme switch
{
Themes.SYSTEM => "Synchronized with the operating system settings",
Themes.LIGHT => "Always use light theme",
Themes.DARK => "Always use dark theme",
_ => "Unknown setting",
};
}
Themes.SYSTEM => "Synchronized with the operating system settings",
Themes.LIGHT => "Always use light theme",
Themes.DARK => "Always use dark theme",
_ => "Unknown setting",
};
}
@@ -84,7 +84,7 @@ public static class SettingsMigrations
{
Version = Version.V2,
Providers = previousData.Providers.Select(provider => provider with { IsSelfHosted = false, Hostname = "" }).ToList(),
Providers = previousData.Providers.Select(provider => provider with { IsSelfHosted = false, Hostname = string.Empty }).ToList(),
EnableSpellchecking = previousData.EnableSpellchecking,
IsSavingEnergy = previousData.IsSavingEnergy,