Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
lmb-djaquier opened this issue Feb 21, 2024 · 0 comments
Open
2 tasks done

Comments

@lmb-djaquier
Copy link

Prerequisites

  • I have written a descriptive issue title
  • 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant