cake icon indicating copy to clipboard operation
cake copied to clipboard

Bug with InspectCodeSettings parsing in InspectCodeRunner on Linux (and probably MacOS)

Open lmb-djaquier opened this issue 1 year ago • 0 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

4.0.0

Operating system

Linux, macOS

Operating system architecture

64-Bit

CI Server

Teamcity

What are you seeing?

Parameters are starting with a / (see output logs) . With a / they are not considered as parameters but as paths, so the output of the InspectCode.sh script is the error "Specify only one solution file".

Regarding the sourcecode of the runner, that bug impacts all parameters, except --no-build

What is expected?

Parameters must start with a - or -- (like already implemented for the --no-build parameter but not the others) on Linux and MacOS operating systems

Steps to Reproduce

Configure your inspectcode in cake with some parameters that way:

context.InspectCode(context.PathToSolution, new InspectCodeSettings
{
    OutputFile = "output.json",
    Debug = true,
    Build = false,
    SolutionWideAnalysis = false,
    Severity = InspectCodeSeverity.Warning,
    Verbosity = InspectCodeVerbosity.Trace
}
.WithToolPath("<toolpath>/JetBrains.ReSharper.CommandLineTools.2023.3.3/tools/inspectcode.sh")
);

To make it work, currently i used that workaround:

context.InspectCode(context.PathToSolution, new InspectCodeSettings
{
    Build = false,
    ArgumentCustomization = args => args.Append("--swea --severity=WARNING --output=output.json"),
}
.WithToolPath("<toolpath>/JetBrains.ReSharper.CommandLineTools.2023.3.3/tools/inspectcode.sh")
);

Output log

##teamcity[blockOpened name='Code Inspection'] Executing: /source/solution/build/tools/JetBrains.ReSharper.CommandLineTools.2023.3.3/tools/inspectcode.sh "/output:/source/solution/output/reports/inspectCode.xml" /debug "/verbosity=TRACE" "/severity=WARNING" --no-build "/source/solution/Jsnow.sln" JetBrains Inspect Code 2023.3.3 Running on x64 OS in x64 architecture, .NET 8.0.2 under Ubuntu 22.04.3 LTS Specify only one solution file Usage: inspectcode [options] [solution or project file] Show help: inspectcode --help An error occurred when executing task 'App.CodeInspection'. Error: InspectCode: Process returned an error (exit code 1).

lmb-djaquier avatar Feb 21 '24 10:02 lmb-djaquier