fsprojects / FSharpLint

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

AvoidTooShortNames rule does not work on short function argument name #632

Closed Mersho closed 9 months ago

Mersho commented 9 months ago

Description

The AvoidTooShortNames rule doesn't give warning on a short name function argument.

Steps To Reproduce

• 1. The following files should be included in an example project:

ConsoleApp.fsproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <WarnOn>3390;$(WarnOn)</WarnOn>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

</Project>

Program.fs

open System

type Foo() =
    member this.BarMethod(x: int) =
        x.ToString()

• 2. dotnet fsharplint lint ..\ConsoleApp\ConsoleApp\ConsoleApp.fsproj

Current Results

========== Linting C:\Users\PC\source\repos\ConsoleApp\ConsoleApp\obj\Debug\net5.0\ConsoleApp.AssemblyInfo.fs ==========
========== Finished: 0 warnings ==========
========== Linting C:\Users\PC\source\repos\ConsoleApp\ConsoleApp\Program.fs ==========
========== Finished: 0 warnings ==========
========== Summary: 0 warnings ==========

Expected behavior

The rule should warn about using short identifiers.

Related information