Skip to content

Can't lint on sln/slnx and fsproj #740

Closed

Description

@sharpchen

Not able to lint on sln/slnx and fsproj

Version

$ dotnet-fsharplint --version
Current version: 0.24.2+143ae50e0e32d0842fa36c1bc22c735f2c72f114

Repro

Proj file

$ dotnet build ./src/FSharpLint.Core/FSharpLint.Core.fsproj

Restore complete (0.5s)
  FSharpLint.Core succeeded (0.4s) → src/FSharpLint.Core/bin/Debug/net9.0/FSharpLint.Core.dll

Build succeeded in 1.5s

$ dotnet-fsharplint --format msbuild lint ./src/FSharpLint.Core/FSharpLint.Core.fsproj

FSharpLint error: Lint failed to parse files. Failed with: Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.

Slnx

$ dotnet-fsharplint --format msbuild lint ./fsharp-console.sln

FSharpLint error: Lint failed to parse files. Failed with: Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.
Type check failed. You might want to build your solution/project first and try again.

$ dotnet-fsharplint --format msbuild lint ./fsharp-console.slnx

========== Linting <inline source> ==========
========== Finished: 0 warnings ==========
========== Summary: 0 warnings ==========

Activity

  1. changed the title [-]Can't lint for specified fsproj file[/-] [+]Can't lint for specified fsproj file & empty result for sln/slnx on lint[/+] on Jul 10, 2025
  2. changed the title [-]Can't lint for specified fsproj file & empty result for sln/slnx on lint[/-] [+]Can't lint on sln/slnx and fsproj[/+] on Jul 10, 2025
  3. Numpsy commented on Jul 10, 2025

    @Numpsy
    Contributor

    .slnx files should be supported in the next release - #723 - which should also fix the problems when running on .NET 9

  4. Numpsy commented on Jul 11, 2025

    @Numpsy
    Contributor

    This should be working in the nre 0.25 release

  5. sharpchen commented on Jul 11, 2025

    @sharpchen
    Author

    @Numpsy Thanks, it works on latest version. But I noticed that the diagnostics are now concatenated as one single line, is it expected?

    PS /> dotnet-fsharplint --format msbuild lint ./fsharp-console.fsproj | where { $_ -notmatch '^=+' }
    /home/sharpchen/projects/fsharp-console/Program.fs(7,4,15,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`./home/sharpchen/projects/fsharp-console/Program.fs(7,4,14,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`./home/sharpchen/projects/fsharp-console/Program.fs(7,4,13,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`./home/sharpchen/projects/fsharp-console/Program.fs(7,4,12,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`./home/sharpchen/projects/fsharp-console/Program.fs(7,4,11,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`./home/sharpchen/projects/fsharp-console/Program.fs(7,4,10,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`./home/sharpchen/projects/fsharp-console/Program.fs(7,4,9,17):FSharpLint warning FL0065: `List.map f (List.map g x)` might be able to be refactored into `List.map (g >> f) x`.========== Finished: 7 warnings ==========
    PS /> dotnet-fsharplint --format msbuild lint ./fsharp-console.fsproj | where { $_ -notmatch '^=+' } | measure -Line
    
    Lines Words Characters Property
    ----- ----- ---------- --------
        1
  6. xperiandri commented on Jul 11, 2025

    @xperiandri
    Collaborator

    0.25.0 supports slnx and slnf please try and close if fixed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions