From b01107b986bef1e98a4060cae667400a630c2380 Mon Sep 17 00:00:00 2001 From: Alexander Nachtmann Date: Wed, 14 Oct 2026 22:23:54 +0200 Subject: [PATCH 1/3] Restore the ReSharper tool wrapper for jb inspectcode and cleanupcode - Bring back src/Fallout.Common/Tools/ReSharper, which was deleted with the JetBrains tooling cleanup (97ea857f), updated to the options of the jb global tool 2026.2. dupfinder is gone: JetBrains removed it. - The tool path is RESHARPER_EXE, then jb on the PATH (the global .NET tool), then the JetBrains.ReSharper.GlobalTools package in the NuGet packages folder. - Add ToolPathResolver.TryGetPathExecutable, which returns null instead of failing when the executable is not on the PATH. - The CLI tools table lists the commands the wrapper has. Co-Authored-By: Claude Opus 5.5 --- docs/website/03-common/08-cli-tools.md | 2 +- .../Tools/ReSharper/ReSharper.Generated.cs | 1226 +++++++++++++++++ .../Tools/ReSharper/ReSharper.json | 371 +++++ .../Tools/ReSharper/ReSharperTasks.cs | 30 + src/Fallout.Tooling/ToolPathResolver.cs | 16 +- 5 files changed, 1640 insertions(+), 5 deletions(-) create mode 100644 src/Fallout.Common/Tools/ReSharper/ReSharper.Generated.cs create mode 100644 src/Fallout.Common/Tools/ReSharper/ReSharper.json create mode 100644 src/Fallout.Common/Tools/ReSharper/ReSharperTasks.cs diff --git a/docs/website/03-common/08-cli-tools.md b/docs/website/03-common/08-cli-tools.md index f3e8c9675..4d7e66e9a 100644 --- a/docs/website/03-common/08-cli-tools.md +++ b/docs/website/03-common/08-cli-tools.md @@ -54,7 +54,7 @@ Interacting with third-party command-line interface tools (CLIs) is an essential | [PowerShell](https://docs.microsoft.com/en-us/powershell/) | _Single top-level command_ | | [Pulumi](https://www.pulumi.com/) | `config`, `config cp`, `config get`, `config refresh`, `config rm`, `config set`, `destroy`, `new`, `preview`, `stack`, `stack change-secrets-provider`, `stack export`, `stack graph`, `stack history`, `stack import`, `stack init`, `stack ls`, `stack output`, `stack rename`, `stack rm`, `stack select`, `stack tag get`, `stack tag ls`, `stack tag rm`, `stack tag set`, `up` | | [ReportGenerator](https://github.com/danielpalme/ReportGenerator) | _Single top-level command_ | -| [ReSharper](https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html) | `cleanupcode`, `dupfinder`, `inspectcode` | +| [ReSharper](https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html) | `cleanupcode`, `inspectcode` | | [SignClient](https://discoverdot.net/projects/sign-service) | `sign` | | [SignTool](https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe) | `sign` | | [SonarScanner](https://www.sonarqube.org/) | `begin`, `end` | diff --git a/src/Fallout.Common/Tools/ReSharper/ReSharper.Generated.cs b/src/Fallout.Common/Tools/ReSharper/ReSharper.Generated.cs new file mode 100644 index 000000000..f91581927 --- /dev/null +++ b/src/Fallout.Common/Tools/ReSharper/ReSharper.Generated.cs @@ -0,0 +1,1226 @@ +// Generated from https://github.com/Fallout-build/Fallout/blob/develop/src/Fallout.Common/Tools/ReSharper/ReSharper.json + +using Fallout.Common; +using Fallout.Common.Tooling; +using Fallout.Common.Tools; +using Fallout.Common.Utilities.Collections; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; + +namespace Fallout.Common.Tools.ReSharper; + +///

The ReSharper command line tools run ReSharper's code inspections and code cleanup outside the IDE. They ship as the jb global .NET tool (package JetBrains.ReSharper.GlobalTools).The tool path is resolved in this order: the RESHARPER_EXE environment variable, a jb executable on the PATH (for example, after dotnet tool install --global JetBrains.ReSharper.GlobalTools), and then the JetBrains.ReSharper.GlobalTools package in the NuGet packages folder (add it as a PackageDownload item to the build project).

For more details, visit the official website.

+[ExcludeFromCodeCoverage] +[NuGetTool(Id = PackageId, Executable = PackageExecutable)] +public partial class ReSharperTasks : ToolTasks, IRequireNuGetPackage +{ + public static string ReSharperPath { get => new ReSharperTasks().GetToolPathInternal(); set => new ReSharperTasks().SetToolPath(value); } + public const string PackageId = "JetBrains.ReSharper.GlobalTools"; + public const string PackageExecutable = "JetBrains.CommandLine.Products.dll"; + ///

The ReSharper command line tools run ReSharper's code inspections and code cleanup outside the IDE. They ship as the jb global .NET tool (package JetBrains.ReSharper.GlobalTools).The tool path is resolved in this order: the RESHARPER_EXE environment variable, a jb executable on the PATH (for example, after dotnet tool install --global JetBrains.ReSharper.GlobalTools), and then the JetBrains.ReSharper.GlobalTools package in the NuGet packages folder (add it as a PackageDownload item to the build project).

For more details, visit the official website.

+ public static IReadOnlyCollection ReSharper(ArgumentStringHandler arguments, string workingDirectory = null, IReadOnlyDictionary environmentVariables = null, int? timeout = null, bool? logOutput = null, bool? logInvocation = null, Action logger = null, Func exitHandler = null) => new ReSharperTasks().Run(arguments, workingDirectory, environmentVariables, timeout, logOutput, logInvocation, logger, exitHandler); + ///

InspectCode runs ReSharper's code inspections on a solution or project and writes the issues it finds to a report. The default report format is SARIF.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • --absolute-paths via
  • --build via
  • --caches-home via
  • --config via
  • --config-create via
  • --debug via
  • --disable-settings-layers via
  • --dotnetcore via
  • --dotnetcoresdk via
  • --dumpIssuesTypes via
  • --exclude via
  • --eXtensions via
  • --format via
  • --include via
  • --jobs via
  • --LogFile via
  • --LogFolder via
  • --LogLevel via
  • --measure via
  • --mono via
  • --no-build via
  • --no-buildin-settings via
  • --no-swea via
  • --no-updates via
  • --output via
  • --project via
  • --properties via
  • --settings via
  • --severity via
  • --source via
  • --stdout via
  • --swea via
  • --target via
  • --target-framework via
  • --targets-for-items via
  • --targets-for-references via
  • --toolset via
  • --toolset-path via
  • --verbosity via
+ public static IReadOnlyCollection ReSharperInspectCode(ReSharperInspectCodeSettings options = null) => new ReSharperTasks().Run(options); + /// + public static IReadOnlyCollection ReSharperInspectCode(Configure configurator) => new ReSharperTasks().Run(configurator.Invoke(new ReSharperInspectCodeSettings())); + /// + public static IEnumerable<(ReSharperInspectCodeSettings Settings, IReadOnlyCollection Output)> ReSharperInspectCode(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(ReSharperInspectCode, degreeOfParallelism, completeOnFailure); + ///

CleanupCode runs a code cleanup profile on a solution or project, so that formatting and code style issues are fixed across the code base.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • --build via
  • --caches-home via
  • --config via
  • --config-create via
  • --debug via
  • --disable-settings-layers via
  • --dotnetcore via
  • --dotnetcoresdk via
  • --exclude via
  • --eXtensions via
  • --include via
  • --LogFile via
  • --LogFolder via
  • --LogLevel via
  • --measure via
  • --mono via
  • --no-build via
  • --no-buildin-settings via
  • --no-updates via
  • --profile via
  • --properties via
  • --settings via
  • --source via
  • --target via
  • --targets-for-items via
  • --targets-for-references via
  • --toolset via
  • --toolset-path via
  • --verbosity via
+ public static IReadOnlyCollection ReSharperCleanupCode(ReSharperCleanupCodeSettings options = null) => new ReSharperTasks().Run(options); + /// + public static IReadOnlyCollection ReSharperCleanupCode(Configure configurator) => new ReSharperTasks().Run(configurator.Invoke(new ReSharperCleanupCodeSettings())); + /// + public static IEnumerable<(ReSharperCleanupCodeSettings Settings, IReadOnlyCollection Output)> ReSharperCleanupCode(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(ReSharperCleanupCode, degreeOfParallelism, completeOnFailure); +} +#region ReSharperInspectCodeSettings +/// +[ExcludeFromCodeCoverage] +[Command(Type = typeof(ReSharperTasks), Command = nameof(ReSharperTasks.ReSharperInspectCode), Arguments = "inspectcode")] +public partial class ReSharperInspectCodeSettings : ToolOptions +{ + /// The solution or project file to inspect. + [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); + /// The report file. Use - to write the report to stdout. + [Argument(Format = "--output={value}")] public string Output => Get(() => Output); + /// Write the report to stdout. + [Argument(Format = "--stdout")] public bool? Stdout => Get(() => Stdout); + /// The report format. The default is Sarif. + [Argument(Format = "--format={value}")] public ReSharperFormat Format => Get(() => Format); + /// Run up to this many jobs in parallel. 0 means as many as possible, which is the default. + [Argument(Format = "--jobs={value}")] public int? Jobs => Get(() => Jobs); + /// Write absolute paths to the report. By default, paths are relative to the solution file. + [Argument(Format = "--absolute-paths")] public bool? AbsolutePaths => Get(() => AbsolutePaths); + /// Turn off solution-wide analysis. + [Argument(Format = "--no-swea")] public bool? NoSwea => Get(() => NoSwea); + /// Turn on solution-wide analysis. + [Argument(Format = "--swea")] public bool? Swea => Get(() => Swea); + /// Inspect only the projects that match this wildcard, for example --project=*Billing. By default, all projects in the solution are inspected. + [Argument(Format = "--project={value}")] public string Project => Get(() => Project); + /// Inspect for one target framework only, for example net10.0. By default, all frameworks are inspected. + [Argument(Format = "--target-framework={value}")] public string TargetFramework => Get(() => TargetFramework); + /// The lowest severity to report. The default is SUGGESTION. + [Argument(Format = "--severity={value}")] public ReSharperSeverity Severity => Get(() => Severity); + /// Write all known code inspections to the report instead of inspecting code. Use it without a target path. + [Argument(Format = "--dumpIssuesTypes")] public bool? DumpIssuesTypes => Get(() => DumpIssuesTypes); + /// A .DotSettings file whose settings override all other settings layers. By default, the team-shared layer of the solution is used if it exists. + [Argument(Format = "--settings={value}")] public string Settings => Get(() => Settings); + /// The settings layers to turn off. + [Argument(Format = "--disable-settings-layers={value}", Separator = ";")] public IReadOnlyList DisableSettingsLayers => Get>(() => DisableSettingsLayers); + /// Turn off all global, solution and project settings layers. Same as --disable-settings-layers=GlobalAll;GlobalPerProduct;SolutionShared;SolutionPersonal;ProjectShared;ProjectPersonal. + [Argument(Format = "--no-buildin-settings")] public bool? NoBuiltinSettings => Get(() => NoBuiltinSettings); + /// ReSharper extensions to install and use. Available extensions are listed in the plugin repository. + [Argument(Format = "--eXtensions={value}", Separator = ";")] public IReadOnlyList Extensions => Get>(() => Extensions); + /// The sources to install extensions from. + [Argument(Format = "--source={value}", Separator = ";")] public IReadOnlyList Sources => Get>(() => Sources); + /// The directory for ReSharper's caches. + [Argument(Format = "--caches-home={value}")] public string CachesHome => Get(() => CachesHome); + /// Save the current parameters to this configuration file. + [Argument(Format = "--config-create={value}")] public string CreateConfigFile => Get(() => CreateConfigFile); + /// Load the parameters from this configuration file. + [Argument(Format = "--config={value}")] public string ConfigFile => Get(() => ConfigFile); + /// How much information to write to the console. The default is INFO. + [Argument(Format = "--verbosity={value}")] public ReSharperVerbosity Verbosity => Get(() => Verbosity); + /// Show debugging messages. + [Argument(Format = "--debug")] public bool? Debug => Get(() => Debug); + /// Don't check for updates. + [Argument(Format = "--no-updates")] public bool? NoUpdates => Get(() => NoUpdates); + /// The logging level. + [Argument(Format = "--LogLevel={value}")] public ReSharperVerbosity LogLevel => Get(() => LogLevel); + /// The log file. + [Argument(Format = "--LogFile={value}")] public string LogFile => Get(() => LogFile); + /// The log folder. + [Argument(Format = "--LogFolder={value}")] public string LogFolder => Get(() => LogFolder); + /// Measure the tool's own performance. + [Argument(Format = "--measure={value}")] public ReSharperMeasure Measure => Get(() => Measure); + /// MSBuild properties that apply to all analyzed projects. + [Argument(Format = "--properties:{key}={value}")] public IReadOnlyDictionary Properties => Get>(() => Properties); + /// The MSBuild toolset version, for example 17.0. By default, the highest available version is used. + [Argument(Format = "--toolset={value}")] public string Toolset => Get(() => Toolset); + /// The path to the MSBuild executable or DLL. + [Argument(Format = "--toolset-path={value}")] public string ToolsetPath => Get(() => ToolsetPath); + /// The path to the dotnet executable. By default, it is detected automatically. + [Argument(Format = "--dotnetcore={value}")] public string DotNetCore => Get(() => DotNetCore); + /// The .NET SDK version that provides MSBuild, for example 10.0.100. + [Argument(Format = "--dotnetcoresdk={value}")] public string DotNetCoreSdk => Get(() => DotNetCoreSdk); + /// The path to Mono. Leave it empty to ignore Mono. + [Argument(Format = "--mono={value}")] public string MonoPath => Get(() => MonoPath); + /// MSBuild targets that are run to get the referenced assemblies of projects. + [Argument(Format = "--targets-for-references={value}", Separator = ";")] public IReadOnlyList ReferenceTargets => Get>(() => ReferenceTargets); + /// MSBuild targets that are run to get other items of projects, for example Compile items. + [Argument(Format = "--targets-for-items={value}", Separator = ";")] public IReadOnlyList ItemTargets => Get>(() => ItemTargets); + /// Build the solution before processing. This is the default. + [Argument(Format = "--build")] public bool? Build => Get(() => Build); + /// Don't build the solution before processing. Use it when the solution is already built. + [Argument(Format = "--no-build")] public bool? NoBuild => Get(() => NoBuild); + /// The MSBuild target to run before processing. The default is Build. + [Argument(Format = "--target={value}")] public string Target => Get(() => Target); + /// Process only the files that match these relative paths or wildcards (* and **). + [Argument(Format = "--include={value}", Separator = ";")] public IReadOnlyList Includes => Get>(() => Includes); + /// Skip the files that match these relative paths or wildcards (* and **). --exclude wins over --include. + [Argument(Format = "--exclude={value}", Separator = ";")] public IReadOnlyList Excludes => Get>(() => Excludes); +} +#endregion +#region ReSharperCleanupCodeSettings +/// +[ExcludeFromCodeCoverage] +[Command(Type = typeof(ReSharperTasks), Command = nameof(ReSharperTasks.ReSharperCleanupCode), Arguments = "cleanupcode")] +public partial class ReSharperCleanupCodeSettings : ToolOptions +{ + /// The solution or project file to clean up. + [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); + /// The name of the code cleanup profile to run. By default, the Built-in: Full Cleanup profile is used. + [Argument(Format = "--profile={value}")] public string Profile => Get(() => Profile); + /// A .DotSettings file whose settings override all other settings layers. By default, the team-shared layer of the solution is used if it exists. + [Argument(Format = "--settings={value}")] public string Settings => Get(() => Settings); + /// The settings layers to turn off. + [Argument(Format = "--disable-settings-layers={value}", Separator = ";")] public IReadOnlyList DisableSettingsLayers => Get>(() => DisableSettingsLayers); + /// Turn off all global, solution and project settings layers. Same as --disable-settings-layers=GlobalAll;GlobalPerProduct;SolutionShared;SolutionPersonal;ProjectShared;ProjectPersonal. + [Argument(Format = "--no-buildin-settings")] public bool? NoBuiltinSettings => Get(() => NoBuiltinSettings); + /// ReSharper extensions to install and use. Available extensions are listed in the plugin repository. + [Argument(Format = "--eXtensions={value}", Separator = ";")] public IReadOnlyList Extensions => Get>(() => Extensions); + /// The sources to install extensions from. + [Argument(Format = "--source={value}", Separator = ";")] public IReadOnlyList Sources => Get>(() => Sources); + /// The directory for ReSharper's caches. + [Argument(Format = "--caches-home={value}")] public string CachesHome => Get(() => CachesHome); + /// Save the current parameters to this configuration file. + [Argument(Format = "--config-create={value}")] public string CreateConfigFile => Get(() => CreateConfigFile); + /// Load the parameters from this configuration file. + [Argument(Format = "--config={value}")] public string ConfigFile => Get(() => ConfigFile); + /// How much information to write to the console. The default is INFO. + [Argument(Format = "--verbosity={value}")] public ReSharperVerbosity Verbosity => Get(() => Verbosity); + /// Show debugging messages. + [Argument(Format = "--debug")] public bool? Debug => Get(() => Debug); + /// Don't check for updates. + [Argument(Format = "--no-updates")] public bool? NoUpdates => Get(() => NoUpdates); + /// The logging level. + [Argument(Format = "--LogLevel={value}")] public ReSharperVerbosity LogLevel => Get(() => LogLevel); + /// The log file. + [Argument(Format = "--LogFile={value}")] public string LogFile => Get(() => LogFile); + /// The log folder. + [Argument(Format = "--LogFolder={value}")] public string LogFolder => Get(() => LogFolder); + /// Measure the tool's own performance. + [Argument(Format = "--measure={value}")] public ReSharperMeasure Measure => Get(() => Measure); + /// MSBuild properties that apply to all analyzed projects. + [Argument(Format = "--properties:{key}={value}")] public IReadOnlyDictionary Properties => Get>(() => Properties); + /// The MSBuild toolset version, for example 17.0. By default, the highest available version is used. + [Argument(Format = "--toolset={value}")] public string Toolset => Get(() => Toolset); + /// The path to the MSBuild executable or DLL. + [Argument(Format = "--toolset-path={value}")] public string ToolsetPath => Get(() => ToolsetPath); + /// The path to the dotnet executable. By default, it is detected automatically. + [Argument(Format = "--dotnetcore={value}")] public string DotNetCore => Get(() => DotNetCore); + /// The .NET SDK version that provides MSBuild, for example 10.0.100. + [Argument(Format = "--dotnetcoresdk={value}")] public string DotNetCoreSdk => Get(() => DotNetCoreSdk); + /// The path to Mono. Leave it empty to ignore Mono. + [Argument(Format = "--mono={value}")] public string MonoPath => Get(() => MonoPath); + /// MSBuild targets that are run to get the referenced assemblies of projects. + [Argument(Format = "--targets-for-references={value}", Separator = ";")] public IReadOnlyList ReferenceTargets => Get>(() => ReferenceTargets); + /// MSBuild targets that are run to get other items of projects, for example Compile items. + [Argument(Format = "--targets-for-items={value}", Separator = ";")] public IReadOnlyList ItemTargets => Get>(() => ItemTargets); + /// Build the solution before processing. This is the default. + [Argument(Format = "--build")] public bool? Build => Get(() => Build); + /// Don't build the solution before processing. Use it when the solution is already built. + [Argument(Format = "--no-build")] public bool? NoBuild => Get(() => NoBuild); + /// The MSBuild target to run before processing. The default is Build. + [Argument(Format = "--target={value}")] public string Target => Get(() => Target); + /// Process only the files that match these relative paths or wildcards (* and **). + [Argument(Format = "--include={value}", Separator = ";")] public IReadOnlyList Includes => Get>(() => Includes); + /// Skip the files that match these relative paths or wildcards (* and **). --exclude wins over --include. + [Argument(Format = "--exclude={value}", Separator = ";")] public IReadOnlyList Excludes => Get>(() => Excludes); +} +#endregion +#region ReSharperInspectCodeSettingsExtensions +/// +[ExcludeFromCodeCoverage] +public static partial class ReSharperInspectCodeSettingsExtensions +{ + #region TargetPath + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.TargetPath))] + public static T SetTargetPath(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.TargetPath, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.TargetPath))] + public static T ResetTargetPath(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.TargetPath)); + #endregion + #region Output + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Output))] + public static T SetOutput(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Output, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Output))] + public static T ResetOutput(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Output)); + #endregion + #region Stdout + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Stdout))] + public static T SetStdout(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Stdout, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Stdout))] + public static T ResetStdout(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Stdout)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Stdout))] + public static T EnableStdout(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Stdout, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Stdout))] + public static T DisableStdout(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Stdout, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Stdout))] + public static T ToggleStdout(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Stdout, !o.Stdout)); + #endregion + #region Format + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Format))] + public static T SetFormat(this T o, ReSharperFormat v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Format, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Format))] + public static T ResetFormat(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Format)); + #endregion + #region Jobs + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Jobs))] + public static T SetJobs(this T o, int? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Jobs, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Jobs))] + public static T ResetJobs(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Jobs)); + #endregion + #region AbsolutePaths + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.AbsolutePaths))] + public static T SetAbsolutePaths(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.AbsolutePaths, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.AbsolutePaths))] + public static T ResetAbsolutePaths(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.AbsolutePaths)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.AbsolutePaths))] + public static T EnableAbsolutePaths(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.AbsolutePaths, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.AbsolutePaths))] + public static T DisableAbsolutePaths(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.AbsolutePaths, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.AbsolutePaths))] + public static T ToggleAbsolutePaths(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.AbsolutePaths, !o.AbsolutePaths)); + #endregion + #region NoSwea + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoSwea))] + public static T SetNoSwea(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoSwea, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoSwea))] + public static T ResetNoSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.NoSwea)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoSwea))] + public static T EnableNoSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoSwea, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoSwea))] + public static T DisableNoSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoSwea, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoSwea))] + public static T ToggleNoSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoSwea, !o.NoSwea)); + #endregion + #region Swea + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Swea))] + public static T SetSwea(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Swea, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Swea))] + public static T ResetSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Swea)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Swea))] + public static T EnableSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Swea, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Swea))] + public static T DisableSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Swea, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Swea))] + public static T ToggleSwea(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Swea, !o.Swea)); + #endregion + #region Project + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Project))] + public static T SetProject(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Project, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Project))] + public static T ResetProject(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Project)); + #endregion + #region TargetFramework + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.TargetFramework))] + public static T SetTargetFramework(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.TargetFramework, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.TargetFramework))] + public static T ResetTargetFramework(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.TargetFramework)); + #endregion + #region Severity + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Severity))] + public static T SetSeverity(this T o, ReSharperSeverity v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Severity, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Severity))] + public static T ResetSeverity(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Severity)); + #endregion + #region DumpIssuesTypes + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DumpIssuesTypes))] + public static T SetDumpIssuesTypes(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DumpIssuesTypes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DumpIssuesTypes))] + public static T ResetDumpIssuesTypes(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.DumpIssuesTypes)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DumpIssuesTypes))] + public static T EnableDumpIssuesTypes(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DumpIssuesTypes, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DumpIssuesTypes))] + public static T DisableDumpIssuesTypes(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DumpIssuesTypes, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DumpIssuesTypes))] + public static T ToggleDumpIssuesTypes(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DumpIssuesTypes, !o.DumpIssuesTypes)); + #endregion + #region Settings + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Settings))] + public static T SetSettings(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Settings, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Settings))] + public static T ResetSettings(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Settings)); + #endregion + #region DisableSettingsLayers + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T SetDisableSettingsLayers(this T o, params ReSharperSettingsLayers[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T SetDisableSettingsLayers(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T AddDisableSettingsLayers(this T o, params ReSharperSettingsLayers[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T AddDisableSettingsLayers(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T RemoveDisableSettingsLayers(this T o, params ReSharperSettingsLayers[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T RemoveDisableSettingsLayers(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DisableSettingsLayers))] + public static T ClearDisableSettingsLayers(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.DisableSettingsLayers)); + #endregion + #region NoBuiltinSettings + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuiltinSettings))] + public static T SetNoBuiltinSettings(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuiltinSettings))] + public static T ResetNoBuiltinSettings(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.NoBuiltinSettings)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuiltinSettings))] + public static T EnableNoBuiltinSettings(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuiltinSettings))] + public static T DisableNoBuiltinSettings(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuiltinSettings))] + public static T ToggleNoBuiltinSettings(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, !o.NoBuiltinSettings)); + #endregion + #region Extensions + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T SetExtensions(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T SetExtensions(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T AddExtensions(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T AddExtensions(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T RemoveExtensions(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T RemoveExtensions(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Extensions))] + public static T ClearExtensions(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.Extensions)); + #endregion + #region Sources + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T SetSources(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T SetSources(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T AddSources(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T AddSources(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T RemoveSources(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T RemoveSources(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Sources))] + public static T ClearSources(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.Sources)); + #endregion + #region CachesHome + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.CachesHome))] + public static T SetCachesHome(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.CachesHome, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.CachesHome))] + public static T ResetCachesHome(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.CachesHome)); + #endregion + #region CreateConfigFile + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.CreateConfigFile))] + public static T SetCreateConfigFile(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.CreateConfigFile, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.CreateConfigFile))] + public static T ResetCreateConfigFile(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.CreateConfigFile)); + #endregion + #region ConfigFile + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ConfigFile))] + public static T SetConfigFile(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ConfigFile))] + public static T ResetConfigFile(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.ConfigFile)); + #endregion + #region Verbosity + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Verbosity))] + public static T SetVerbosity(this T o, ReSharperVerbosity v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion + #region Debug + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Debug))] + public static T SetDebug(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Debug, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Debug))] + public static T ResetDebug(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Debug)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Debug))] + public static T EnableDebug(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Debug, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Debug))] + public static T DisableDebug(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Debug, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Debug))] + public static T ToggleDebug(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Debug, !o.Debug)); + #endregion + #region NoUpdates + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoUpdates))] + public static T SetNoUpdates(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoUpdates))] + public static T ResetNoUpdates(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.NoUpdates)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoUpdates))] + public static T EnableNoUpdates(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoUpdates))] + public static T DisableNoUpdates(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoUpdates))] + public static T ToggleNoUpdates(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, !o.NoUpdates)); + #endregion + #region LogLevel + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.LogLevel))] + public static T SetLogLevel(this T o, ReSharperVerbosity v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.LogLevel, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.LogLevel))] + public static T ResetLogLevel(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.LogLevel)); + #endregion + #region LogFile + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.LogFile))] + public static T SetLogFile(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.LogFile, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.LogFile))] + public static T ResetLogFile(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.LogFile)); + #endregion + #region LogFolder + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.LogFolder))] + public static T SetLogFolder(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.LogFolder, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.LogFolder))] + public static T ResetLogFolder(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.LogFolder)); + #endregion + #region Measure + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Measure))] + public static T SetMeasure(this T o, ReSharperMeasure v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Measure, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Measure))] + public static T ResetMeasure(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Measure)); + #endregion + #region Properties + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Properties))] + public static T SetProperties(this T o, IDictionary v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Properties, v.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase))); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Properties))] + public static T SetProperty(this T o, string k, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.SetDictionary(() => o.Properties, k, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Properties))] + public static T AddProperty(this T o, string k, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddDictionary(() => o.Properties, k, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Properties))] + public static T RemoveProperty(this T o, string k) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveDictionary(() => o.Properties, k)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Properties))] + public static T ClearProperties(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearDictionary(() => o.Properties)); + #endregion + #region Toolset + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Toolset))] + public static T SetToolset(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Toolset, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Toolset))] + public static T ResetToolset(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Toolset)); + #endregion + #region ToolsetPath + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ToolsetPath))] + public static T SetToolsetPath(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.ToolsetPath, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ToolsetPath))] + public static T ResetToolsetPath(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.ToolsetPath)); + #endregion + #region DotNetCore + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DotNetCore))] + public static T SetDotNetCore(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DotNetCore, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DotNetCore))] + public static T ResetDotNetCore(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.DotNetCore)); + #endregion + #region DotNetCoreSdk + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DotNetCoreSdk))] + public static T SetDotNetCoreSdk(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.DotNetCoreSdk, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.DotNetCoreSdk))] + public static T ResetDotNetCoreSdk(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.DotNetCoreSdk)); + #endregion + #region MonoPath + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.MonoPath))] + public static T SetMonoPath(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.MonoPath, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.MonoPath))] + public static T ResetMonoPath(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.MonoPath)); + #endregion + #region ReferenceTargets + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T SetReferenceTargets(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T SetReferenceTargets(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T AddReferenceTargets(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T AddReferenceTargets(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T RemoveReferenceTargets(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T RemoveReferenceTargets(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ReferenceTargets))] + public static T ClearReferenceTargets(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.ReferenceTargets)); + #endregion + #region ItemTargets + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T SetItemTargets(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T SetItemTargets(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T AddItemTargets(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T AddItemTargets(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T RemoveItemTargets(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T RemoveItemTargets(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.ItemTargets))] + public static T ClearItemTargets(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.ItemTargets)); + #endregion + #region Build + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Build))] + public static T SetBuild(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Build, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Build))] + public static T ResetBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Build)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Build))] + public static T EnableBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Build, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Build))] + public static T DisableBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Build, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Build))] + public static T ToggleBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Build, !o.Build)); + #endregion + #region NoBuild + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuild))] + public static T SetNoBuild(this T o, bool? v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuild))] + public static T ResetNoBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.NoBuild)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuild))] + public static T EnableNoBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, true)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuild))] + public static T DisableNoBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, false)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.NoBuild))] + public static T ToggleNoBuild(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, !o.NoBuild)); + #endregion + #region Target + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Target))] + public static T SetTarget(this T o, string v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Target, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Target))] + public static T ResetTarget(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Remove(() => o.Target)); + #endregion + #region Includes + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T SetIncludes(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T SetIncludes(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T AddIncludes(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T AddIncludes(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T RemoveIncludes(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T RemoveIncludes(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Includes))] + public static T ClearIncludes(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.Includes)); + #endregion + #region Excludes + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T SetExcludes(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T SetExcludes(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.Set(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T AddExcludes(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T AddExcludes(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.AddCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T RemoveExcludes(this T o, params string[] v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T RemoveExcludes(this T o, IEnumerable v) where T : ReSharperInspectCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperInspectCodeSettings), Property = nameof(ReSharperInspectCodeSettings.Excludes))] + public static T ClearExcludes(this T o) where T : ReSharperInspectCodeSettings => o.Modify(b => b.ClearCollection(() => o.Excludes)); + #endregion +} +#endregion +#region ReSharperCleanupCodeSettingsExtensions +/// +[ExcludeFromCodeCoverage] +public static partial class ReSharperCleanupCodeSettingsExtensions +{ + #region TargetPath + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.TargetPath))] + public static T SetTargetPath(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.TargetPath, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.TargetPath))] + public static T ResetTargetPath(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.TargetPath)); + #endregion + #region Profile + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Profile))] + public static T SetProfile(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Profile, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Profile))] + public static T ResetProfile(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Profile)); + #endregion + #region Settings + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Settings))] + public static T SetSettings(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Settings, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Settings))] + public static T ResetSettings(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Settings)); + #endregion + #region DisableSettingsLayers + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T SetDisableSettingsLayers(this T o, params ReSharperSettingsLayers[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T SetDisableSettingsLayers(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T AddDisableSettingsLayers(this T o, params ReSharperSettingsLayers[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T AddDisableSettingsLayers(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T RemoveDisableSettingsLayers(this T o, params ReSharperSettingsLayers[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T RemoveDisableSettingsLayers(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.DisableSettingsLayers, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DisableSettingsLayers))] + public static T ClearDisableSettingsLayers(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.DisableSettingsLayers)); + #endregion + #region NoBuiltinSettings + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuiltinSettings))] + public static T SetNoBuiltinSettings(this T o, bool? v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuiltinSettings))] + public static T ResetNoBuiltinSettings(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.NoBuiltinSettings)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuiltinSettings))] + public static T EnableNoBuiltinSettings(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, true)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuiltinSettings))] + public static T DisableNoBuiltinSettings(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, false)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuiltinSettings))] + public static T ToggleNoBuiltinSettings(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuiltinSettings, !o.NoBuiltinSettings)); + #endregion + #region Extensions + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T SetExtensions(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T SetExtensions(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T AddExtensions(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T AddExtensions(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T RemoveExtensions(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T RemoveExtensions(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Extensions, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Extensions))] + public static T ClearExtensions(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.Extensions)); + #endregion + #region Sources + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T SetSources(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T SetSources(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T AddSources(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T AddSources(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T RemoveSources(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T RemoveSources(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Sources, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Sources))] + public static T ClearSources(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.Sources)); + #endregion + #region CachesHome + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.CachesHome))] + public static T SetCachesHome(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.CachesHome, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.CachesHome))] + public static T ResetCachesHome(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.CachesHome)); + #endregion + #region CreateConfigFile + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.CreateConfigFile))] + public static T SetCreateConfigFile(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.CreateConfigFile, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.CreateConfigFile))] + public static T ResetCreateConfigFile(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.CreateConfigFile)); + #endregion + #region ConfigFile + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ConfigFile))] + public static T SetConfigFile(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ConfigFile))] + public static T ResetConfigFile(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.ConfigFile)); + #endregion + #region Verbosity + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Verbosity))] + public static T SetVerbosity(this T o, ReSharperVerbosity v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion + #region Debug + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Debug))] + public static T SetDebug(this T o, bool? v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Debug, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Debug))] + public static T ResetDebug(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Debug)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Debug))] + public static T EnableDebug(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Debug, true)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Debug))] + public static T DisableDebug(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Debug, false)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Debug))] + public static T ToggleDebug(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Debug, !o.Debug)); + #endregion + #region NoUpdates + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoUpdates))] + public static T SetNoUpdates(this T o, bool? v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoUpdates))] + public static T ResetNoUpdates(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.NoUpdates)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoUpdates))] + public static T EnableNoUpdates(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, true)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoUpdates))] + public static T DisableNoUpdates(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, false)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoUpdates))] + public static T ToggleNoUpdates(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoUpdates, !o.NoUpdates)); + #endregion + #region LogLevel + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.LogLevel))] + public static T SetLogLevel(this T o, ReSharperVerbosity v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.LogLevel, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.LogLevel))] + public static T ResetLogLevel(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.LogLevel)); + #endregion + #region LogFile + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.LogFile))] + public static T SetLogFile(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.LogFile, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.LogFile))] + public static T ResetLogFile(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.LogFile)); + #endregion + #region LogFolder + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.LogFolder))] + public static T SetLogFolder(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.LogFolder, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.LogFolder))] + public static T ResetLogFolder(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.LogFolder)); + #endregion + #region Measure + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Measure))] + public static T SetMeasure(this T o, ReSharperMeasure v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Measure, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Measure))] + public static T ResetMeasure(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Measure)); + #endregion + #region Properties + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Properties))] + public static T SetProperties(this T o, IDictionary v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Properties, v.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase))); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Properties))] + public static T SetProperty(this T o, string k, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.SetDictionary(() => o.Properties, k, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Properties))] + public static T AddProperty(this T o, string k, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddDictionary(() => o.Properties, k, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Properties))] + public static T RemoveProperty(this T o, string k) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveDictionary(() => o.Properties, k)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Properties))] + public static T ClearProperties(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearDictionary(() => o.Properties)); + #endregion + #region Toolset + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Toolset))] + public static T SetToolset(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Toolset, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Toolset))] + public static T ResetToolset(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Toolset)); + #endregion + #region ToolsetPath + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ToolsetPath))] + public static T SetToolsetPath(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.ToolsetPath, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ToolsetPath))] + public static T ResetToolsetPath(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.ToolsetPath)); + #endregion + #region DotNetCore + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DotNetCore))] + public static T SetDotNetCore(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.DotNetCore, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DotNetCore))] + public static T ResetDotNetCore(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.DotNetCore)); + #endregion + #region DotNetCoreSdk + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DotNetCoreSdk))] + public static T SetDotNetCoreSdk(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.DotNetCoreSdk, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.DotNetCoreSdk))] + public static T ResetDotNetCoreSdk(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.DotNetCoreSdk)); + #endregion + #region MonoPath + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.MonoPath))] + public static T SetMonoPath(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.MonoPath, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.MonoPath))] + public static T ResetMonoPath(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.MonoPath)); + #endregion + #region ReferenceTargets + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T SetReferenceTargets(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T SetReferenceTargets(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T AddReferenceTargets(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T AddReferenceTargets(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T RemoveReferenceTargets(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T RemoveReferenceTargets(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ReferenceTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ReferenceTargets))] + public static T ClearReferenceTargets(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.ReferenceTargets)); + #endregion + #region ItemTargets + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T SetItemTargets(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T SetItemTargets(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T AddItemTargets(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T AddItemTargets(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T RemoveItemTargets(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T RemoveItemTargets(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.ItemTargets, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.ItemTargets))] + public static T ClearItemTargets(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.ItemTargets)); + #endregion + #region Build + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Build))] + public static T SetBuild(this T o, bool? v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Build, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Build))] + public static T ResetBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Build)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Build))] + public static T EnableBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Build, true)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Build))] + public static T DisableBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Build, false)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Build))] + public static T ToggleBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Build, !o.Build)); + #endregion + #region NoBuild + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuild))] + public static T SetNoBuild(this T o, bool? v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuild))] + public static T ResetNoBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.NoBuild)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuild))] + public static T EnableNoBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, true)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuild))] + public static T DisableNoBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, false)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.NoBuild))] + public static T ToggleNoBuild(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.NoBuild, !o.NoBuild)); + #endregion + #region Target + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Target))] + public static T SetTarget(this T o, string v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Target, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Target))] + public static T ResetTarget(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Remove(() => o.Target)); + #endregion + #region Includes + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T SetIncludes(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T SetIncludes(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T AddIncludes(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T AddIncludes(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T RemoveIncludes(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T RemoveIncludes(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Includes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Includes))] + public static T ClearIncludes(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.Includes)); + #endregion + #region Excludes + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T SetExcludes(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T SetExcludes(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.Set(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T AddExcludes(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T AddExcludes(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.AddCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T RemoveExcludes(this T o, params string[] v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T RemoveExcludes(this T o, IEnumerable v) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.RemoveCollection(() => o.Excludes, v)); + /// + [Builder(Type = typeof(ReSharperCleanupCodeSettings), Property = nameof(ReSharperCleanupCodeSettings.Excludes))] + public static T ClearExcludes(this T o) where T : ReSharperCleanupCodeSettings => o.Modify(b => b.ClearCollection(() => o.Excludes)); + #endregion +} +#endregion +#region ReSharperSettingsLayers +/// Used within . +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class ReSharperSettingsLayers : Enumeration +{ + public static ReSharperSettingsLayers GlobalAll = (ReSharperSettingsLayers) "GlobalAll"; + public static ReSharperSettingsLayers GlobalPerProduct = (ReSharperSettingsLayers) "GlobalPerProduct"; + public static ReSharperSettingsLayers SolutionShared = (ReSharperSettingsLayers) "SolutionShared"; + public static ReSharperSettingsLayers SolutionPersonal = (ReSharperSettingsLayers) "SolutionPersonal"; + public static ReSharperSettingsLayers ProjectShared = (ReSharperSettingsLayers) "ProjectShared"; + public static ReSharperSettingsLayers ProjectPersonal = (ReSharperSettingsLayers) "ProjectPersonal"; + public static implicit operator ReSharperSettingsLayers(string value) + { + return new ReSharperSettingsLayers { Value = value }; + } +} +#endregion +#region ReSharperFormat +/// Used within . +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class ReSharperFormat : Enumeration +{ + public static ReSharperFormat Xml = (ReSharperFormat) "Xml"; + public static ReSharperFormat Html = (ReSharperFormat) "Html"; + public static ReSharperFormat Text = (ReSharperFormat) "Text"; + public static ReSharperFormat Sarif = (ReSharperFormat) "Sarif"; + public static implicit operator ReSharperFormat(string value) + { + return new ReSharperFormat { Value = value }; + } +} +#endregion +#region ReSharperVerbosity +/// Used within . +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class ReSharperVerbosity : Enumeration +{ + public static ReSharperVerbosity OFF = (ReSharperVerbosity) "OFF"; + public static ReSharperVerbosity FATAL = (ReSharperVerbosity) "FATAL"; + public static ReSharperVerbosity ERROR = (ReSharperVerbosity) "ERROR"; + public static ReSharperVerbosity WARN = (ReSharperVerbosity) "WARN"; + public static ReSharperVerbosity INFO = (ReSharperVerbosity) "INFO"; + public static ReSharperVerbosity VERBOSE = (ReSharperVerbosity) "VERBOSE"; + public static ReSharperVerbosity TRACE = (ReSharperVerbosity) "TRACE"; + public static implicit operator ReSharperVerbosity(string value) + { + return new ReSharperVerbosity { Value = value }; + } +} +#endregion +#region ReSharperSeverity +/// Used within . +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class ReSharperSeverity : Enumeration +{ + public static ReSharperSeverity INFO = (ReSharperSeverity) "INFO"; + public static ReSharperSeverity HINT = (ReSharperSeverity) "HINT"; + public static ReSharperSeverity SUGGESTION = (ReSharperSeverity) "SUGGESTION"; + public static ReSharperSeverity WARNING = (ReSharperSeverity) "WARNING"; + public static ReSharperSeverity ERROR = (ReSharperSeverity) "ERROR"; + public static implicit operator ReSharperSeverity(string value) + { + return new ReSharperSeverity { Value = value }; + } +} +#endregion +#region ReSharperMeasure +/// Used within . +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class ReSharperMeasure : Enumeration +{ + public static ReSharperMeasure MEMORY = (ReSharperMeasure) "MEMORY"; + public static ReSharperMeasure SAMPLING = (ReSharperMeasure) "SAMPLING"; + public static ReSharperMeasure TIMELINE = (ReSharperMeasure) "TIMELINE"; + public static implicit operator ReSharperMeasure(string value) + { + return new ReSharperMeasure { Value = value }; + } +} +#endregion diff --git a/src/Fallout.Common/Tools/ReSharper/ReSharper.json b/src/Fallout.Common/Tools/ReSharper/ReSharper.json new file mode 100644 index 000000000..27f394138 --- /dev/null +++ b/src/Fallout.Common/Tools/ReSharper/ReSharper.json @@ -0,0 +1,371 @@ +{ + "$schema": "https://raw.githubusercontent.com/Fallout-build/Fallout/main/src/Fallout.Tooling.Generator/schema.json", + "references": [ + "https://www.jetbrains.com/help/resharper/InspectCode.html#//article[@class='article']", + "https://www.jetbrains.com/help/resharper/CleanupCode.html#//article[@class='article']" + ], + "name": "ReSharper", + "officialUrl": "https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html", + "help": "The ReSharper command line tools run ReSharper's code inspections and code cleanup outside the IDE. They ship as the jb global .NET tool (package JetBrains.ReSharper.GlobalTools).The tool path is resolved in this order: the RESHARPER_EXE environment variable, a jb executable on the PATH (for example, after dotnet tool install --global JetBrains.ReSharper.GlobalTools), and then the JetBrains.ReSharper.GlobalTools package in the NuGet packages folder (add it as a PackageDownload item to the build project).", + "nugetPackageId": "JetBrains.ReSharper.GlobalTools", + "packageExecutable": "JetBrains.CommandLine.Products.dll", + "tasks": [ + { + "help": "InspectCode runs ReSharper's code inspections on a solution or project and writes the issues it finds to a report. The default report format is SARIF.", + "postfix": "InspectCode", + "commonPropertySets": [ + "resharper", + "auxiliary", + "msbuild", + "include-exclude" + ], + "definiteArgument": "inspectcode", + "officialUrl": "https://www.jetbrains.com/help/resharper/InspectCode.html", + "settingsClass": { + "properties": [ + { + "name": "TargetPath", + "type": "string", + "format": "{value}", + "position": 1, + "createOverload": true, + "help": "The solution or project file to inspect." + }, + { + "name": "Output", + "type": "string", + "format": "--output={value}", + "help": "The report file. Use - to write the report to stdout." + }, + { + "name": "Stdout", + "type": "bool", + "format": "--stdout", + "help": "Write the report to stdout." + }, + { + "name": "Format", + "type": "ReSharperFormat", + "format": "--format={value}", + "help": "The report format. The default is Sarif." + }, + { + "name": "Jobs", + "type": "int", + "format": "--jobs={value}", + "help": "Run up to this many jobs in parallel. 0 means as many as possible, which is the default." + }, + { + "name": "AbsolutePaths", + "type": "bool", + "format": "--absolute-paths", + "help": "Write absolute paths to the report. By default, paths are relative to the solution file." + }, + { + "name": "NoSwea", + "type": "bool", + "format": "--no-swea", + "help": "Turn off solution-wide analysis." + }, + { + "name": "Swea", + "type": "bool", + "format": "--swea", + "help": "Turn on solution-wide analysis." + }, + { + "name": "Project", + "type": "string", + "format": "--project={value}", + "help": "Inspect only the projects that match this wildcard, for example --project=*Billing. By default, all projects in the solution are inspected." + }, + { + "name": "TargetFramework", + "type": "string", + "format": "--target-framework={value}", + "help": "Inspect for one target framework only, for example net10.0. By default, all frameworks are inspected." + }, + { + "name": "Severity", + "type": "ReSharperSeverity", + "format": "--severity={value}", + "help": "The lowest severity to report. The default is SUGGESTION." + }, + { + "name": "DumpIssuesTypes", + "type": "bool", + "format": "--dumpIssuesTypes", + "help": "Write all known code inspections to the report instead of inspecting code. Use it without a target path." + } + ] + } + }, + { + "help": "CleanupCode runs a code cleanup profile on a solution or project, so that formatting and code style issues are fixed across the code base.", + "postfix": "CleanupCode", + "commonPropertySets": [ + "resharper", + "auxiliary", + "msbuild", + "include-exclude" + ], + "definiteArgument": "cleanupcode", + "officialUrl": "https://www.jetbrains.com/help/resharper/CleanupCode.html", + "settingsClass": { + "properties": [ + { + "name": "TargetPath", + "type": "string", + "format": "{value}", + "position": 1, + "createOverload": true, + "help": "The solution or project file to clean up." + }, + { + "name": "Profile", + "type": "string", + "format": "--profile={value}", + "help": "The name of the code cleanup profile to run. By default, the Built-in: Full Cleanup profile is used." + } + ] + } + } + ], + "commonTaskPropertySets": { + "resharper": [ + { + "name": "Settings", + "type": "string", + "format": "--settings={value}", + "help": "A .DotSettings file whose settings override all other settings layers. By default, the team-shared layer of the solution is used if it exists." + }, + { + "name": "DisableSettingsLayers", + "type": "List", + "format": "--disable-settings-layers={value}", + "separator": ";", + "help": "The settings layers to turn off." + }, + { + "name": "NoBuiltinSettings", + "type": "bool", + "format": "--no-buildin-settings", + "help": "Turn off all global, solution and project settings layers. Same as --disable-settings-layers=GlobalAll;GlobalPerProduct;SolutionShared;SolutionPersonal;ProjectShared;ProjectPersonal." + }, + { + "name": "Extensions", + "type": "List", + "format": "--eXtensions={value}", + "separator": ";", + "help": "ReSharper extensions to install and use. Available extensions are listed in the plugin repository." + }, + { + "name": "Sources", + "type": "List", + "format": "--source={value}", + "separator": ";", + "help": "The sources to install extensions from." + } + ], + "auxiliary": [ + { + "name": "CachesHome", + "type": "string", + "format": "--caches-home={value}", + "help": "The directory for ReSharper's caches." + }, + { + "name": "CreateConfigFile", + "type": "string", + "format": "--config-create={value}", + "help": "Save the current parameters to this configuration file." + }, + { + "name": "ConfigFile", + "type": "string", + "format": "--config={value}", + "help": "Load the parameters from this configuration file." + }, + { + "name": "Verbosity", + "type": "ReSharperVerbosity", + "format": "--verbosity={value}", + "help": "How much information to write to the console. The default is INFO." + }, + { + "name": "Debug", + "type": "bool", + "format": "--debug", + "help": "Show debugging messages." + }, + { + "name": "NoUpdates", + "type": "bool", + "format": "--no-updates", + "help": "Don't check for updates." + }, + { + "name": "LogLevel", + "type": "ReSharperVerbosity", + "format": "--LogLevel={value}", + "help": "The logging level." + }, + { + "name": "LogFile", + "type": "string", + "format": "--LogFile={value}", + "help": "The log file." + }, + { + "name": "LogFolder", + "type": "string", + "format": "--LogFolder={value}", + "help": "The log folder." + }, + { + "name": "Measure", + "type": "ReSharperMeasure", + "format": "--measure={value}", + "help": "Measure the tool's own performance." + } + ], + "msbuild": [ + { + "name": "Properties", + "type": "Dictionary", + "format": "--properties:{key}={value}", + "help": "MSBuild properties that apply to all analyzed projects." + }, + { + "name": "Toolset", + "type": "string", + "format": "--toolset={value}", + "help": "The MSBuild toolset version, for example 17.0. By default, the highest available version is used." + }, + { + "name": "ToolsetPath", + "type": "string", + "format": "--toolset-path={value}", + "help": "The path to the MSBuild executable or DLL." + }, + { + "name": "DotNetCore", + "type": "string", + "format": "--dotnetcore={value}", + "help": "The path to the dotnet executable. By default, it is detected automatically." + }, + { + "name": "DotNetCoreSdk", + "type": "string", + "format": "--dotnetcoresdk={value}", + "help": "The .NET SDK version that provides MSBuild, for example 10.0.100." + }, + { + "name": "MonoPath", + "type": "string", + "format": "--mono={value}", + "help": "The path to Mono. Leave it empty to ignore Mono." + }, + { + "name": "ReferenceTargets", + "type": "List", + "format": "--targets-for-references={value}", + "separator": ";", + "help": "MSBuild targets that are run to get the referenced assemblies of projects." + }, + { + "name": "ItemTargets", + "type": "List", + "format": "--targets-for-items={value}", + "separator": ";", + "help": "MSBuild targets that are run to get other items of projects, for example Compile items." + }, + { + "name": "Build", + "type": "bool", + "format": "--build", + "help": "Build the solution before processing. This is the default." + }, + { + "name": "NoBuild", + "type": "bool", + "format": "--no-build", + "help": "Don't build the solution before processing. Use it when the solution is already built." + }, + { + "name": "Target", + "type": "string", + "format": "--target={value}", + "help": "The MSBuild target to run before processing. The default is Build." + } + ], + "include-exclude": [ + { + "name": "Includes", + "type": "List", + "format": "--include={value}", + "separator": ";", + "help": "Process only the files that match these relative paths or wildcards (* and **)." + }, + { + "name": "Excludes", + "type": "List", + "format": "--exclude={value}", + "separator": ";", + "help": "Skip the files that match these relative paths or wildcards (* and **). --exclude wins over --include." + } + ] + }, + "enumerations": [ + { + "name": "ReSharperSettingsLayers", + "values": [ + "GlobalAll", + "GlobalPerProduct", + "SolutionShared", + "SolutionPersonal", + "ProjectShared", + "ProjectPersonal" + ] + }, + { + "name": "ReSharperFormat", + "values": [ + "Xml", + "Html", + "Text", + "Sarif" + ] + }, + { + "name": "ReSharperVerbosity", + "values": [ + "OFF", + "FATAL", + "ERROR", + "WARN", + "INFO", + "VERBOSE", + "TRACE" + ] + }, + { + "name": "ReSharperSeverity", + "values": [ + "INFO", + "HINT", + "SUGGESTION", + "WARNING", + "ERROR" + ] + }, + { + "name": "ReSharperMeasure", + "values": [ + "MEMORY", + "SAMPLING", + "TIMELINE" + ] + } + ] +} diff --git a/src/Fallout.Common/Tools/ReSharper/ReSharperTasks.cs b/src/Fallout.Common/Tools/ReSharper/ReSharperTasks.cs new file mode 100644 index 000000000..4e5545c7c --- /dev/null +++ b/src/Fallout.Common/Tools/ReSharper/ReSharperTasks.cs @@ -0,0 +1,30 @@ +using Fallout.Common.CI.TeamCity; +using Fallout.Common.Tooling; + +namespace Fallout.Common.Tools.ReSharper; + +partial class ReSharperTasks +{ + /// The executable of the JetBrains.ReSharper.GlobalTools global .NET tool. + public const string PathExecutable = "jb"; + + /// + /// Uses the jb global .NET tool from the PATH when it is installed, and the + /// JetBrains.ReSharper.GlobalTools package from the NuGet packages folder otherwise. + /// The RESHARPER_EXE environment variable overrides both. + /// + protected override string GetToolPath(ToolOptions options = null) + { + return ToolPathResolver.TryGetPathExecutable(PathExecutable) + ?? NuGetToolPathResolver.GetPackageExecutable(PackageId, PackageExecutable); + } + + protected override void PostProcess(ToolOptions options) + { + // TeamCity's inspection importer reads the XML report format only. + if (options is ReSharperInspectCodeSettings { Output: { } output } settings && settings.Format == ReSharperFormat.Xml) + { + TeamCity.Instance?.ImportData(TeamCityImportType.ReSharperInspectCode, output); + } + } +} diff --git a/src/Fallout.Tooling/ToolPathResolver.cs b/src/Fallout.Tooling/ToolPathResolver.cs index 898ac4ed9..eb899f312 100644 --- a/src/Fallout.Tooling/ToolPathResolver.cs +++ b/src/Fallout.Tooling/ToolPathResolver.cs @@ -22,6 +22,16 @@ public static string TryGetEnvironmentExecutable(string environmentExecutable) } public static string GetPathExecutable(string pathExecutable) + { + return TryGetPathExecutable(pathExecutable) + .NotNull($"Could not find '{pathExecutable}' on the PATH."); + } + + /// + /// Returns the full path of when it exists as a file or + /// is found on the PATH (via which or where), otherwise null. + /// + public static string TryGetPathExecutable(string pathExecutable) { if (File.Exists(pathExecutable)) { @@ -46,8 +56,7 @@ string GetExecutableFullPath(string path) Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries); - return paths.Select(GetExecutableFullPath).FirstOrDefault(File.Exists) - .NotNull($"Could not find '{pathExecutable}' on the PATH."); + return paths.Select(GetExecutableFullPath).FirstOrDefault(File.Exists); } var locateProcess = ProcessTasks.StartProcess( @@ -61,7 +70,6 @@ string GetExecutableFullPath(string path) return locateProcess.Output .Select(x => x.Text) .Where(x => (EnvironmentInfo.IsWin && Path.HasExtension(x)) || EnvironmentInfo.IsUnix) - .FirstOrDefault(File.Exists) - .NotNull($"Could not find '{pathExecutable}' via '{locateExecutable}'."); + .FirstOrDefault(File.Exists); } } From f037d3c25df93b7db1e4d82c543ee1b5eea25074 Mon Sep 17 00:00:00 2001 From: Alexander Nachtmann Date: Wed, 14 Oct 2026 22:23:54 +0200 Subject: [PATCH 2/3] Skip [Experimental] types in the transition shim generator An experimental type is new surface with no NUKE-era consumers. A Nuke.* shim that derives from it fails the shim project's build with the experimental diagnostic, so the generator now skips such types without a SHIM001 warning. Co-Authored-By: Claude Opus 5.5 --- .../TransitionShimGenerator.cs | 15 ++++- .../TransitionShimGeneratorSpecs.cs | 61 +++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/Fallout.SourceGenerators/TransitionShimGenerator.cs b/src/Fallout.SourceGenerators/TransitionShimGenerator.cs index ccaf02d94..5a0e345b7 100644 --- a/src/Fallout.SourceGenerators/TransitionShimGenerator.cs +++ b/src/Fallout.SourceGenerators/TransitionShimGenerator.cs @@ -324,6 +324,13 @@ private static void EmitOrSkipType(SourceProductionContext ctx, INamedTypeSymbol return; } + // An [Experimental] type is new surface with no NUKE-era consumers to bridge, and a + // shim that derives from it would trip the experimental diagnostic in the shim project. + if (IsExperimental(type)) + { + return; + } + var fqn = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); if (ambiguousFqns.Contains(fqn)) { @@ -359,6 +366,10 @@ private static void EmitOrSkipType(SourceProductionContext ctx, INamedTypeSymbol ctx.AddSource(hint, source); } + private static bool IsExperimental(INamedTypeSymbol type) + => type.GetAttributes().Any(x => + x.AttributeClass?.ToDisplayString() == "System.Diagnostics.CodeAnalysis.ExperimentalAttribute"); + private static bool IsLanguageLimitKind(string skipReason) => skipReason is "enum" or "delegate" or "struct"; @@ -531,9 +542,9 @@ private static void EmitTypeBody(StringBuilder sb, INamedTypeSymbol type, int in continue; } - if (ClassifyForSkip(nested) is not null) + if (ClassifyForSkip(nested) is not null || IsExperimental(nested)) { - continue; // skip Hard-tier nesteds silently for now + continue; // skip Hard-tier and experimental nesteds silently for now } sb.AppendLine(); diff --git a/tests/Fallout.SourceGenerators.Specs/TransitionShimGeneratorSpecs.cs b/tests/Fallout.SourceGenerators.Specs/TransitionShimGeneratorSpecs.cs index b37db0800..e1f9b5871 100644 --- a/tests/Fallout.SourceGenerators.Specs/TransitionShimGeneratorSpecs.cs +++ b/tests/Fallout.SourceGenerators.Specs/TransitionShimGeneratorSpecs.cs @@ -124,6 +124,67 @@ public static class HandBridgedRegular { } result.Diagnostics.Should().BeEmpty(); } + // An [Experimental] type is new surface without NUKE-era consumers. A shim deriving from it + // would fail the shim project's build with the experimental diagnostic, so it gets none. + [Fact] + public void SkipsExperimentalTypesSilently() + { + var canonical = CompileCanonicalAssembly(""" + namespace System.Diagnostics.CodeAnalysis + { + [System.AttributeUsage(System.AttributeTargets.All)] + public sealed class ExperimentalAttribute : System.Attribute + { + public ExperimentalAttribute(string diagnosticId) {} + } + } + + namespace Fallout.Common + { + [System.Diagnostics.CodeAnalysis.Experimental("FALLOUT999")] + public interface INewSurface { } + + [System.Diagnostics.CodeAnalysis.Experimental("FALLOUT999")] + public sealed class NewSealedSurface { } + + public class Stable + { + public Stable() {} + + [System.Diagnostics.CodeAnalysis.Experimental("FALLOUT999")] + public class NewNested { public NewNested() {} } + } + } + """); + + var shimCompilation = CSharpCompilation.Create("Nuke.Experimental", + new[] + { + CSharpSyntaxTree.ParseText(""" + [assembly: Fallout.Migrate.Shims.ShimAllPublicTypesUnder("Fallout.Common", "Nuke.Common")] + """) + }, + NetStandard20.References.All + .Concat(new[] + { + canonical + }), + new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + + var driver = CSharpGeneratorDriver.Create(new TransitionShimGenerator()); + var result = driver.RunGenerators(shimCompilation).GetRunResult(); + + // Only the stable type gets a shim, and it leaves out the experimental nested type. + var shims = result.GeneratedTrees + .Where(t => !t.FilePath.EndsWith("ShimAllPublicTypesUnderAttribute.g.cs", StringComparison.Ordinal)) + .ToList(); + shims.Should().ContainSingle(); + shims[0].ToString().Should().Contain("class Stable").And.NotContain("NewNested"); + + // No SHIM001 for the sealed experimental class either. + result.Diagnostics.Should().BeEmpty(); + } + [Fact] public void EmitsNothingWhenNoMarkerAttributePresent() { From c0e6434adc036e88ebda3e88a3371b46a33cbec9 Mon Sep 17 00:00:00 2001 From: Alexander Nachtmann Date: Wed, 14 Oct 2026 22:23:54 +0200 Subject: [PATCH 3/3] Add the IInspect component that sorts ReSharper and Roslyn findings into triage buckets `fallout Inspect` runs one `dotnet build --no-incremental` that writes a Roslyn SARIF error log per project and target framework, then `jb inspectcode --severity=HINT --no-swea --no-build`. It merges both reports, drops suppressed results and findings in obj/ or generated files, keeps one finding per rule, file and line, and sorts each finding into runtime-candidate, review, mechanical or unclassified with an overridable rule table. Test files are flagged. - Reports: inspect.sarif, inspect.tsv and inspect.md in the reports directory, and one count line per bucket on stderr. - The target only reports. A failing build or tool logs a warning. - A single ErrorLog path for a solution build would be overwritten by every compiler call, so an imported targets file gives each project its own error log. - New public API is behind [Experimental("FALLOUT005")]. FALLOUT002 to FALLOUT004 are already used by other warnings. Co-Authored-By: Claude Opus 5.5 --- docs/experimental-apis.md | 3 + src/Fallout.Components/IInspect.cs | 144 ++++++ src/Fallout.Components/InspectReport.cs | 424 ++++++++++++++++++ src/Fallout.Components/InspectRuleTable.cs | 153 +++++++ .../Fallout.Components.Specs.csproj | 2 + .../InspectReportSpecs.cs | 185 ++++++++ 6 files changed, 911 insertions(+) create mode 100644 src/Fallout.Components/IInspect.cs create mode 100644 src/Fallout.Components/InspectReport.cs create mode 100644 src/Fallout.Components/InspectRuleTable.cs create mode 100644 tests/Fallout.Components.Specs/InspectReportSpecs.cs diff --git a/docs/experimental-apis.md b/docs/experimental-apis.md index 3d6a57390..870656c88 100644 --- a/docs/experimental-apis.md +++ b/docs/experimental-apis.md @@ -50,6 +50,9 @@ Status values: **Experimental** (live, opt-in), **Promoted** (attribute removed, | ID | Surface | Introduced | Status | Notes | |----|---------|------------|--------|-------| | `FALLOUT001` | `Fallout.Components.IPublish.PublishTargets` / `.PublishTo` (multi-channel publishing) | 10.5.x | Experimental | Fan a single `Pack` output across multiple feeds with per-feed package-ID routing (`PublishTarget`). Shape may change while the CD model firms up (epic #332). Promote by deleting the attribute once `ReleaseChannel`/`DeploymentTarget` (#334) settle. | +| `FALLOUT005` | `Fallout.Components.IInspect`, `InspectReport`, `InspectRuleTable`, `InspectFinding`, `InspectBucket` (inspection triage) | 10.5.x | Experimental | `Inspect` target: one Roslyn SARIF error log per project plus ReSharper `inspectcode`, merged and sorted into triage buckets (`inspect.sarif`, `inspect.tsv`, `inspect.md`). The rule table and bucket names may change after use in more repositories. | + +`FALLOUT002` to `FALLOUT004` are taken by warnings that are not experimental APIs: the legacy environment variable warning, the legacy keychain warning and the `fallout-migrate` analyzer. Allocate the next experimental ID after the highest `FALLOUT0xx` used anywhere in the repository. + $(NoWarn);FALLOUT005 diff --git a/tests/Fallout.Components.Specs/InspectReportSpecs.cs b/tests/Fallout.Components.Specs/InspectReportSpecs.cs new file mode 100644 index 000000000..d597b7405 --- /dev/null +++ b/tests/Fallout.Components.Specs/InspectReportSpecs.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Fallout.Common.IO; +using FluentAssertions; +using Xunit; + +namespace Fallout.Components.Specs; + +public class InspectReportSpecs : IDisposable +{ + private readonly AbsolutePath root; + private readonly AbsolutePath reSharperSarif; + private readonly AbsolutePath roslynSarif; + + public InspectReportSpecs() + { + root = AbsolutePath.Temp("inspect-report"); + reSharperSarif = root / "resharper.sarif"; + roslynSarif = root / "roslyn.sarif"; + + // ReSharper writes paths relative to the solution directory through a uriBaseId. + reSharperSarif.WriteAllText($$""" + { + "version": "2.1.0", + "runs": [{ + "tool": { "driver": { "name": "InspectCode" } }, + "originalUriBaseIds": { "solutionDir": { "uri": "{{new Uri(root + "/").AbsoluteUri}}" } }, + "results": [ + {{Result("SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault", "note", "src/Store/Metrics.cs", 307, baseId: true)}}, + {{Result("PossibleMultipleEnumeration", "warning", "src/Analysis/Engine.cs", 171, column: 65, baseId: true)}}, + {{Result("PossibleMultipleEnumeration", "warning", "src/Analysis/Engine.cs", 171, column: 98, baseId: true)}}, + {{Result("RedundantNameQualifier", "warning", "tests/Store.Tests/MetricSpecs.cs", 12, baseId: true)}}, + {{Result("CA1822", "warning", "src/Build.cs", 96, baseId: true)}}, + {{Result("InconsistentNaming", "note", "src/Store/Metrics.Generated.cs", 3, baseId: true)}} + ] + }] + } + """); + + // Roslyn writes absolute file URIs and keeps suppressed diagnostics in the log. + roslynSarif.WriteAllText($$""" + { + "version": "2.1.0", + "runs": [{ + "tool": { "driver": { "name": "Microsoft (R) Visual C# Compiler" } }, + "results": [ + {{Result("CA2100", "note", FileUri("src/Store/Store.cs"), 85)}}, + {{Result("CA1822", "warning", FileUri("src/Build.cs"), 96)}}, + {{Result("CA1307", "note", FileUri("src/Store/Store.cs"), 40, suppressed: true)}}, + {{Result("IDE0005", "note", FileUri("artifacts/obj/Store/GlobalUsings.cs"), 1)}}, + {{Result("CA1002", "note", "file:///outside/the/root/Other.cs", 5)}}, + { "ruleId": "AD0001", "level": "warning", "message": { "text": "Analyzer threw" } } + ] + }] + } + """); + } + + public void Dispose() => root.DeleteDirectory(); + + [Fact] + public void Reading_drops_suppressed_generated_obj_outside_and_locationless_results() + { + // Act + var findings = InspectReport.Read(roslynSarif, root, "Roslyn"); + + // Assert + findings.Select(x => (x.RuleId, x.File, x.Line)).Should().Equal( + ("CA2100", "src/Store/Store.cs", 85), + ("CA1822", "src/Build.cs", 96)); + } + + [Fact] + public void Reading_resolves_paths_relative_to_the_uri_base() + { + // Act + var findings = InspectReport.Read(reSharperSarif, root, "ReSharper"); + + // Assert + findings.Should().HaveCount(5); + findings[0].File.Should().Be("src/Store/Metrics.cs"); + findings[1].Column.Should().Be(65); + findings.Should().OnlyContain(x => x.Tool == "ReSharper"); + } + + [Fact] + public void Merging_keeps_one_finding_per_rule_file_and_line_across_tools() + { + // Arrange + var findings = InspectReport.Read(roslynSarif, root, "Roslyn") + .Concat(InspectReport.Read(reSharperSarif, root, "ReSharper")); + + // Act + var merged = InspectReport.Merge(findings, InspectRuleTable.Default); + + // Assert + merged.Should().HaveCount(5); + merged.Should().ContainSingle(x => x.RuleId == "PossibleMultipleEnumeration"); + merged.Should().ContainSingle(x => x.RuleId == "CA1822").Which.Tool.Should().Be("Roslyn"); + } + + [Fact] + public void Merging_sorts_findings_into_buckets_and_flags_test_files() + { + // Arrange + var findings = InspectReport.Read(roslynSarif, root, "Roslyn") + .Concat(InspectReport.Read(reSharperSarif, root, "ReSharper")); + + // Act + var merged = InspectReport.Merge(findings, InspectRuleTable.Default); + + // Assert + merged.Select(x => (x.RuleId, x.Bucket, x.IsTest)).Should().Equal( + ("PossibleMultipleEnumeration", InspectBucket.RuntimeCandidate, false), + ("SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault", InspectBucket.RuntimeCandidate, false), + ("CA2100", InspectBucket.Review, false), + ("CA1822", InspectBucket.Mechanical, false), + ("RedundantNameQualifier", InspectBucket.Mechanical, true)); + } + + [Fact] + public void The_first_matching_rule_sets_the_bucket() + { + // Arrange + var rules = new List<(string Rule, InspectBucket Bucket)> + { + ("CA1307", InspectBucket.RuntimeCandidate), + ("CA*", InspectBucket.Mechanical), + }; + + // Act / Assert + InspectReport.Classify("CA1307", rules).Should().Be(InspectBucket.RuntimeCandidate); + InspectReport.Classify("ca1002", rules).Should().Be(InspectBucket.Mechanical); + InspectReport.Classify("SomeNewRule", rules).Should().Be(InspectBucket.Unclassified); + } + + [Fact] + public void Count_lines_name_every_bucket_with_its_test_share() + { + // Arrange + var merged = InspectReport.Merge(InspectReport.Read(reSharperSarif, root, "ReSharper"), InspectRuleTable.Default); + + // Act + var lines = InspectReport.GetCountLines(merged); + + // Assert + lines.Should().Equal( + "inspect: runtime-candidate 2 (tests 0)", + "inspect: review 0 (tests 0)", + "inspect: mechanical 2 (tests 1)", + "inspect: unclassified 0 (tests 0)"); + } + + [Fact] + public void Tsv_report_has_a_header_and_one_row_per_finding() + { + // Arrange + var merged = InspectReport.Merge(InspectReport.Read(roslynSarif, root, "Roslyn"), InspectRuleTable.Default); + + // Act + var rows = InspectReport.ToTsv(merged).TrimEnd('\n').Split('\n'); + + // Assert + rows.Should().Equal( + "bucket\ttest\trule\tlevel\ttool\tfile\tline\tcolumn\tmessage", + "review\t\tCA2100\tnote\tRoslyn\tsrc/Store/Store.cs\t85\t1\tCA2100 message", + "mechanical\t\tCA1822\twarning\tRoslyn\tsrc/Build.cs\t96\t1\tCA1822 message"); + } + + private string FileUri(string relativePath) => new Uri(root / relativePath).AbsoluteUri; + + private static string Result(string ruleId, string level, string uri, int line, int column = 1, bool baseId = false, bool suppressed = false) + => $$""" + { + "ruleId": "{{ruleId}}", + "level": "{{level}}", + "message": { "text": "{{ruleId}} message" }, + "locations": [{ "physicalLocation": { + "artifactLocation": { "uri": "{{uri}}"{{(baseId ? ", \"uriBaseId\": \"solutionDir\"" : "")}} }, + "region": { "startLine": {{line}}, "startColumn": {{column}} } + } }]{{(suppressed ? ", \"suppressions\": [{ \"kind\": \"inSource\" }]" : "")}} + } + """; +}