Skip to content

Console: enhanced warning reporting #681

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mersho
Copy link
Contributor

@Mersho Mersho commented Jan 16, 2024

Improved warning reporting to display line number and column
in the format: fileName.fs(lineNumber, column).

This feature is particularly useful in environments like
VSCode, which highlights these locations and makes them
clickable. When clicked, VSCode will open the corresponding
file at the exact line and position of the cursor.
This functionality allows developers to quickly navigate to the
source of the issue, significantly speeding up the
debugging process.

@Mersho
Copy link
Contributor Author

Mersho commented Jan 16, 2024

Also we could use workflow annotations, but it would cause extra warnings. This is because the "SelfCheck" step runs three times, once for each operating system and we may encounter additional and repetitive warnings.

@Mersho Mersho force-pushed the UpdateWarnings branch 4 times, most recently from f8e42d8 to 0004f69 Compare January 16, 2024 10:05
@knocte
Copy link
Collaborator

knocte commented Jan 16, 2024

This is because the "SelfCheck" step runs three times, once for each operating system and we may encounter additional and repetitive warnings.

I don't understand this claim.

Copy link
Collaborator

@xperiandri xperiandri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase, please

Improved warning reporting to display line number and column
in the format: `fileName.fs(lineNumber, column)`.

This feature is particularly useful in environments like
VSCode, which highlights these locations and makes them
clickable. When clicked, VSCode will open the corresponding
file at the exact line and position of the cursor.
This functionality allows developers to quickly navigate to the
source of the issue, significantly speeding up the
debugging process.
@Mersho
Copy link
Contributor Author

Mersho commented Jul 18, 2025

I rebased, and here is what the new warning message looks like:

$ dotnet run --project .\src\FSharpLint.Console\ --framework net9.0 lint C:\Users\PC\source\repos\FSharpLint\tests\FSharpLint.Benchmarks\Benchmark.fs
========== Linting C:\Users\PC\source\repos\FSharpLint\tests\FSharpLint.Benchmarks\Benchmark.fs ==========
`x = true` might be able to be refactored into `x`.
Error on line 14 starting at column 43: C:\Users\PC\source\repos\FSharpLint\tests\FSharpLint.Benchmarks\Benchmark.fs(14,43)
        let checker = FSharpChecker.Create(keepAssemblyContents=true)
                                           ^
See https://fsprojects.github.io/FSharpLint/how-tos/rules/FL0065.html
--------------------------------------------------------------------------------
========== Finished: 1 warnings ==========
========== Summary: 1 warnings ==========

@xperiandri
Copy link
Collaborator

But at the beginning of the output, there is a line ========== Linting C:\Users\PC\source\repos\FSharpLint\tests\FSharpLint.Benchmarks\Benchmark.fs ==========
And MSBuild output format switch already defines a very similar format.
I don't think that this change makes sense

Could you compare your new output to the output with -f msbuild switch and check if it meets your needs?

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

Successfully merging this pull request may close these issues.

3 participants