Skip to content

CLI tool: add flag to print ONLY warnings #340

Open

Description

@Kelvin4702

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

Activity

  1. added this to the Version 1.0.0 milestone on May 31, 2020
  2. artempyanykh commented on Jun 8, 2022

    @artempyanykh

    Curious, was there any change here?

    Meantime kudos @Kelvin4702 for a workaround!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions