fsprojects / fsprojects/FSharpLint

TupleCommaSpacing false positive

Open
#567 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

TupleCommaSpacing rule triggers when the tuple comma spacing is correct in named optional parameter assignments.

Repro steps
type TestClass(arg1 : int, ?arg2 : int) =
    class end

let x = TestClass(1, ?arg2 = Some(2))
Expected behavior

No lint error.

Actual behavior
Comma in tuple instantiation should be followed by single space.
Error on line 45 starting at column 19
let x = TestClass(1, ?arg = Some(2))
Known workarounds

Removing the space in the tuple removes the error:

///...
let x = TestClass(1,?arg = Some(2))
Related information
  • Operating system - macOS
  • Branch - version 0.21.2
  • .NET Runtime, CoreCLR or Mono Version - .NET SDK 6.0.302

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 by locating the TupleCommaSpacing rule and reproducing the F# example with the named optional parameter assignment. Compare its handling of the comma before ?arg2 with the expected spacing, then verify that the example produces no lint error while ordinary tuple spacing remains checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.