fsprojects / FSharpLint

Lint tool for F#
https://fsprojects.github.io/FSharpLint/
MIT License
300 stars 73 forks source link

"Doesn't run" with SDK 8.0.101 #690

Closed SeanTAllen closed 4 months ago

SeanTAllen commented 5 months ago

Description

We upgraded to FSharpLint 0.24.0 from 0.21.10. Linting works fine when run locally with SDK 8.0.100. It fails when run locally with 8.0.101 where it only prints a single no warnings:

========== Summary: 0 warnings ==========

We introduced an intentional lint failure, it is found when using SDK 8.0.100, and nothing is found with SDK 8.0.101. The problem appears unrelated to FSharpLint version change as we can duplicate with every version of FSharpLint 0.21.4 and up. I didn't test with anything prior to 0.21.10.

Notes:

Repro steps

  1. have some code that would cause linting error
  2. install 0.24.0 of FSharpLint dotnet tool
  3. install SDK 8.0.101
  4. lint the code

Expected behavior

I expect that when run with 8.0.101 that we would get the same correct results as with 8.0.100

Actual behavior

Linting appears to not run and only:

========== Summary: 0 warnings ==========

appears

Known workarounds

Downgrade to 8.0.100

Related information

This happens both locally with MacOS and in the latest mcr.microsoft.com/dotnet/sdk:8.0 image.

knocte commented 5 months ago

Hello @SeanTAllen thanks for reporting this bug!

we can duplicate with every version of FSharpLint 0.21.4 and up.

Does this mean that the bug doesn't exist in v0.21.3? Or that you simply didn't test older versions than 0.21.4?

SeanTAllen commented 5 months ago

Didn't test older versions

SeanTAllen commented 5 months ago

Additional information. I tried having our CI that is .101 a single project rather than the entire solution.

dotnet tool restore
dotnet dotnet-fsharplint lint src/Admin.CLI/Admin.CLI.fsproj

The result was:

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.

which does not happen locally with .100

An additional run as:

dotnet tool restore
dotnet build
dotnet dotnet-fsharplint lint src/Admin.CLI/Admin.CLI.fsproj

then results in the same:

========== Summary: 0 warnings ==========

I did this test as I thought "perhaps it is because the solution features "nested projects" as each of our projects is in a src directory. However, that didn't pan out. Going through the solution or not, same result.

SeanTAllen commented 4 months ago

With SDK 8.0.201 and the 0.24.2 linter release, I can no longer recreate this issue.

knocte commented 4 months ago

Thanks @SeanTAllen !