FSharpLint icon indicating copy to clipboard operation
FSharpLint copied to clipboard

CLI tool: add flag to print ONLY warnings

Open Kelvin4702 opened this issue 6 years ago • 1 comments

Description

The current output of the CLI tool includes the lint progress and result for every file. It would be nice to have a way to filter out successful results and only print the warnings.

Repro steps

  1. dotnet fsharplint -f "foo.fsproj"

Expected behavior

========== Linting File2.fs ==========
blah
========== Finished: 1 warnings ==========
========== Summary: 1 warnings ==========

Actual behavior

========== Linting File1.fs ==========
========== Finished: 0 warnings ==========
========== Linting File2.fs ==========
blah
========== Finished: 1 warnings ==========
========== Linting File3.fs ==========
========== Finished: 0 warnings ==========
========== Summary: 1 warnings ==========

Known workarounds

Piping the output into another tool, i.e. grep:

dotnet fsharplint -f "foo.fsproj" | grep -Pzo '(?s)=+ Linting (\N*) =+\n(?!=+ Finished: 0 warnings =+\n).*?=+ Finished: [^0] warnings =+\n'

Related information

  • Operating system: Windows 10 Pro
  • dotnet-fsharplint version: 0.11.1
  • .NET Core version: 2.1.505

Kelvin4702 avatar May 23 '19 15:05 Kelvin4702

Curious, was there any change here?

Meantime kudos @Kelvin4702 for a workaround!

artempyanykh avatar Jun 08 '22 20:06 artempyanykh