fsprojects / fsprojects/FSharpLint

CLI tool: add flag to print ONLY warnings

Open
#340 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
F#
Stars
327
Forks
74
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dotnet fsharplint -f "foo.fsproj" CLI entry point and trace how lint progress and per-file results are printed. Define the new warnings-only flag and verify it suppresses files with zero warnings while retaining warning output and the summary shown in the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.