fsprojects / fsprojects/FSharpLint
TupleCommaSpacing false positive
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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