Skip to content

Use inspectcode.sh on non-Windows platforms (#4313)#4760

Open
1PetarVujakovic wants to merge 1 commit intocake-build:developfrom
1PetarVujakovic:fix-inspectcode-linux-runner
Open

Use inspectcode.sh on non-Windows platforms (#4313)#4760
1PetarVujakovic wants to merge 1 commit intocake-build:developfrom
1PetarVujakovic:fix-inspectcode-linux-runner

Conversation

@1PetarVujakovic
Copy link
Copy Markdown

Fixes #4313

On Linux/macOS installations of ReSharper Command Line Tools the entry point is
"inspectcode.sh", but Cake currently attempts to execute "inspectcode.exe".

This change prefers inspectcode.sh on non-Windows platforms while keeping
".exe" as fallback to preserve compatibility with existing setups and tests.

@1PetarVujakovic
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@devlead
Copy link
Copy Markdown
Member

devlead commented Mar 15, 2026

I'm wondering would the "correct" way be to implement support for the JetBrains.ReSharper.GlobalTools and support the jb inspectcode command mentioned in their docs.

Did a quick test, and it looks like it should work.

// Cake.Tool
#tool dotnet:?package=JetBrains.ReSharper.GlobalTools&version=2025.3.3

// Cake.Sdk
InstallTool("dotnet:?package=JetBrains.ReSharper.GlobalTools&version=2025.3.3");


var projectPath = GetFiles("./src/**/*.csproj")
                .FirstOrDefault() ?? throw new FileNotFoundException("Failed to find csproj");

Command(
    ["jb", "jb.exe"], // jb non-Windows, jb.exe Windows
    new ProcessArgumentBuilder()
        .Append("inspectcode")
        .AppendQuoted(projectPath.FullPath)
        .Append("--stdout")
);

Arguments might need to be prefixed inspectcode as jb can also launch cleanupcode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InspectCode calls the exe file even on Linux, where it doesn't work

2 participants