From c67e5da351d66aa7286609a973396d9c0ab1cd96 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 12 Aug 2025 19:53:56 +0200 Subject: [PATCH 1/9] docs: punctuation consistency * Some dots were missing at the end of sentences/paragraphs. * Using colon and a list of elements rather than parentheses. --- docs/content/how-tos/rules/FL0006.md | 2 +- docs/content/how-tos/rules/FL0010.md | 2 +- docs/content/how-tos/rules/FL0011.md | 2 +- docs/content/how-tos/rules/FL0036.md | 2 +- docs/content/how-tos/rules/FL0037.md | 4 ++-- docs/content/how-tos/rules/FL0038.md | 4 ++-- docs/content/how-tos/rules/FL0039.md | 4 ++-- docs/content/how-tos/rules/FL0040.md | 4 ++-- docs/content/how-tos/rules/FL0041.md | 4 ++-- docs/content/how-tos/rules/FL0042.md | 4 ++-- docs/content/how-tos/rules/FL0043.md | 4 ++-- docs/content/how-tos/rules/FL0044.md | 4 ++-- docs/content/how-tos/rules/FL0045.md | 4 ++-- docs/content/how-tos/rules/FL0046.md | 4 ++-- docs/content/how-tos/rules/FL0047.md | 4 ++-- docs/content/how-tos/rules/FL0048.md | 4 ++-- docs/content/how-tos/rules/FL0049.md | 4 ++-- docs/content/how-tos/rules/FL0050.md | 6 +++--- docs/content/how-tos/rules/FL0055.md | 4 ++-- docs/content/how-tos/rules/FL0056.md | 4 ++-- docs/content/how-tos/rules/FL0057.md | 2 +- docs/content/how-tos/rules/FL0058.md | 4 ++-- docs/content/how-tos/rules/FL0061.md | 6 +++--- docs/content/how-tos/rules/FL0065.md | 6 +++--- docs/content/how-tos/rules/FL0066.md | 4 ++-- docs/content/how-tos/rules/FL0067.md | 4 ++-- docs/content/how-tos/rules/FL0068.md | 6 +++--- docs/content/how-tos/rules/FL0069.md | 6 +++--- docs/content/how-tos/rules/FL0086.md | 6 +++--- 29 files changed, 59 insertions(+), 59 deletions(-) diff --git a/docs/content/how-tos/rules/FL0006.md b/docs/content/how-tos/rules/FL0006.md index c36134fce..43202fabe 100644 --- a/docs/content/how-tos/rules/FL0006.md +++ b/docs/content/how-tos/rules/FL0006.md @@ -31,4 +31,4 @@ Uses the `numIndentationSpaces` global setting. } } -* *allowSingleLineLambda* - whether or not to allow single-line lambda pattern matches +* *allowSingleLineLambda* - whether or not to allow single-line lambda pattern matches. diff --git a/docs/content/how-tos/rules/FL0010.md b/docs/content/how-tos/rules/FL0010.md index 26d82c9d6..ba662c132 100644 --- a/docs/content/how-tos/rules/FL0010.md +++ b/docs/content/how-tos/rules/FL0010.md @@ -29,4 +29,4 @@ Update typed item to use configured spacing. } } -* *typedItemStyle* - style of spacing: "NoSpaces", "SpaceAfter", "SpacesAround" +* *typedItemStyle* - style of spacing: "NoSpaces", "SpaceAfter", "SpacesAround". diff --git a/docs/content/how-tos/rules/FL0011.md b/docs/content/how-tos/rules/FL0011.md index b71601b6a..0b482990c 100644 --- a/docs/content/how-tos/rules/FL0011.md +++ b/docs/content/how-tos/rules/FL0011.md @@ -29,4 +29,4 @@ Update higher order type to have correct formatting as per guide linked above. } } -* *mode* - how to enforce the rule ("Hybrid" or "Always" or "Never") +* *mode* - how to enforce the rule: "Hybrid", "Always", or "Never" diff --git a/docs/content/how-tos/rules/FL0036.md b/docs/content/how-tos/rules/FL0036.md index ac85d1e0d..2770077ef 100644 --- a/docs/content/how-tos/rules/FL0036.md +++ b/docs/content/how-tos/rules/FL0036.md @@ -34,6 +34,6 @@ Note, any of the settings below can be omitted and will not be checked. } * *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0037.md b/docs/content/how-tos/rules/FL0037.md index 5fcac04c2..e77f6e13a 100644 --- a/docs/content/how-tos/rules/FL0037.md +++ b/docs/content/how-tos/rules/FL0037.md @@ -33,7 +33,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0038.md b/docs/content/how-tos/rules/FL0038.md index d407c2cb0..aca3b5972 100644 --- a/docs/content/how-tos/rules/FL0038.md +++ b/docs/content/how-tos/rules/FL0038.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0039.md b/docs/content/how-tos/rules/FL0039.md index e1f70a7c3..3a996ed9e 100644 --- a/docs/content/how-tos/rules/FL0039.md +++ b/docs/content/how-tos/rules/FL0039.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0040.md b/docs/content/how-tos/rules/FL0040.md index 88dce6873..3de670ef5 100644 --- a/docs/content/how-tos/rules/FL0040.md +++ b/docs/content/how-tos/rules/FL0040.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0041.md b/docs/content/how-tos/rules/FL0041.md index bf0f6620f..ece7d15c4 100644 --- a/docs/content/how-tos/rules/FL0041.md +++ b/docs/content/how-tos/rules/FL0041.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0042.md b/docs/content/how-tos/rules/FL0042.md index 22bf7fcb7..51315af3d 100644 --- a/docs/content/how-tos/rules/FL0042.md +++ b/docs/content/how-tos/rules/FL0042.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0043.md b/docs/content/how-tos/rules/FL0043.md index 692ab214f..85ea3faaf 100644 --- a/docs/content/how-tos/rules/FL0043.md +++ b/docs/content/how-tos/rules/FL0043.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0044.md b/docs/content/how-tos/rules/FL0044.md index 2744e7b1f..1c6892e4e 100644 --- a/docs/content/how-tos/rules/FL0044.md +++ b/docs/content/how-tos/rules/FL0044.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0045.md b/docs/content/how-tos/rules/FL0045.md index d3bc7dfcb..f8274009f 100644 --- a/docs/content/how-tos/rules/FL0045.md +++ b/docs/content/how-tos/rules/FL0045.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0046.md b/docs/content/how-tos/rules/FL0046.md index 236ecf485..2c1d7280f 100644 --- a/docs/content/how-tos/rules/FL0046.md +++ b/docs/content/how-tos/rules/FL0046.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0047.md b/docs/content/how-tos/rules/FL0047.md index ccf266527..ed8e1f066 100644 --- a/docs/content/how-tos/rules/FL0047.md +++ b/docs/content/how-tos/rules/FL0047.md @@ -31,7 +31,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0048.md b/docs/content/how-tos/rules/FL0048.md index 24cf1ee62..2bdbe4c21 100644 --- a/docs/content/how-tos/rules/FL0048.md +++ b/docs/content/how-tos/rules/FL0048.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0049.md b/docs/content/how-tos/rules/FL0049.md index 13dc1c271..0ed7b8946 100644 --- a/docs/content/how-tos/rules/FL0049.md +++ b/docs/content/how-tos/rules/FL0049.md @@ -31,7 +31,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0050.md b/docs/content/how-tos/rules/FL0050.md index 886881d74..0a0410146 100644 --- a/docs/content/how-tos/rules/FL0050.md +++ b/docs/content/how-tos/rules/FL0050.md @@ -18,7 +18,7 @@ Consistency aides readability. ## How To Fix -Update the non-public value's naming to be consistent with the rules you have specified +Update the non-public value's naming to be consistent with the rules you have specified. ## Rule Settings @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0055.md b/docs/content/how-tos/rules/FL0055.md index c52acfa8d..035f3944f 100644 --- a/docs/content/how-tos/rules/FL0055.md +++ b/docs/content/how-tos/rules/FL0055.md @@ -8,7 +8,7 @@ hide_menu: true ## Cause -A value is binded to a wildcard e.g. `let _ = Console.ReadLine()` +A value is binded to a wildcard e.g. `let _ = Console.ReadLine()`. ## Rationale @@ -16,7 +16,7 @@ Using the ignore function makes it clear what is intended to happen, rather than ## How To Fix -Pipe the value into the ignore function e.g. `Console.ReadLine() |> ignore` +Pipe the value into the ignore function e.g. `Console.ReadLine() |> ignore`. ## Rule Settings diff --git a/docs/content/how-tos/rules/FL0056.md b/docs/content/how-tos/rules/FL0056.md index 0c524d508..2ebab7a9f 100644 --- a/docs/content/how-tos/rules/FL0056.md +++ b/docs/content/how-tos/rules/FL0056.md @@ -8,7 +8,7 @@ hide_menu: true ## Cause -A wildcard is given a name using the as pattern e.g. `match something with | _ as x -> x + y` +A wildcard is given a name using the as pattern e.g. `match something with | _ as x -> x + y`. ## Rationale @@ -16,7 +16,7 @@ The wildcard and as pattern can be replaced with the identifier the value is to ## How To Fix -Replace the wildcard with the identifier the wildcard is currently being bound to, e.g. change `match something with | _ as x -> x + y` to `match something with | x -> x + y` +Replace the wildcard with the identifier the wildcard is currently being bound to, e.g. change `match something with | _ as x -> x + y` to `match something with | x -> x + y`. ## Rule Settings diff --git a/docs/content/how-tos/rules/FL0057.md b/docs/content/how-tos/rules/FL0057.md index 479de3e60..39030837b 100644 --- a/docs/content/how-tos/rules/FL0057.md +++ b/docs/content/how-tos/rules/FL0057.md @@ -8,7 +8,7 @@ hide_menu: true ## Cause -An identifier is binded to itself e.g. `let x = x` +An identifier is binded to itself e.g. `let x = x`. ## Rationale diff --git a/docs/content/how-tos/rules/FL0058.md b/docs/content/how-tos/rules/FL0058.md index a4cea18f7..fa1698c24 100644 --- a/docs/content/how-tos/rules/FL0058.md +++ b/docs/content/how-tos/rules/FL0058.md @@ -8,7 +8,7 @@ hide_menu: true ## Cause -A constructor in a pattern has arguments that consist entirely of wildcards e.g. `SynPat.Paren(_, _)` +A constructor in a pattern has arguments that consist entirely of wildcards e.g. `SynPat.Paren(_, _)`. ## Rationale @@ -16,7 +16,7 @@ The tuple of wildcards can be replaced with a single wildcard. ## How To Fix -Replace the tuple with a single wildcard e.g. the example in the cause could be turned into `SynPat.Paren(_)` +Replace the tuple with a single wildcard e.g. the example in the cause could be turned into `SynPat.Paren(_)`. ## Rule Settings diff --git a/docs/content/how-tos/rules/FL0061.md b/docs/content/how-tos/rules/FL0061.md index d3113b3c5..636e69131 100644 --- a/docs/content/how-tos/rules/FL0061.md +++ b/docs/content/how-tos/rules/FL0061.md @@ -31,6 +31,6 @@ Remove any whitespace from the end of the line. } } -* *numberOfSpacesAllowed* - An integer property that specifies how many space characters are allowed on the end of a line. (Default 1) -* *oneSpaceAllowedAfterOperator* - A boolean property that will allow a single space on the end of the line if it's preceded by an operator/symbol character. (Default true) -* *ignoreBlankLines* - A boolean property that will ignore any lines that are made up of just whitespace. (Default true) +* *numberOfSpacesAllowed* - An integer property that specifies how many space characters are allowed on the end of a line (default: 1). +* *oneSpaceAllowedAfterOperator* - A boolean property that will allow a single space on the end of the line if it's preceded by an operator/symbol character (default: true). +* *ignoreBlankLines* - A boolean property that will ignore any lines that are made up of just whitespace (default: true). diff --git a/docs/content/how-tos/rules/FL0065.md b/docs/content/how-tos/rules/FL0065.md index 5399cd6fc..fbab2d611 100644 --- a/docs/content/how-tos/rules/FL0065.md +++ b/docs/content/how-tos/rules/FL0065.md @@ -18,8 +18,8 @@ Every hint is formed of two parts: the match and the suggestion. Both the match Any F# expression can be matched by a variable or wildcard. -* A variable is represented by a single letter e.g. `x` -* A wildcard is represented by the character `_` +* A variable is represented by a single letter e.g. `x`. +* A wildcard is represented by the character `_`. Variables and wildcards are seemingly the same, and in terms of matching they are. The key difference is that using a variable lets you refer to it in the suggestion, enabling you to show where the matched expression should be moved within the matched code. @@ -59,7 +59,7 @@ In the example above the boolean literal `true` is used to match any F# code whe ### Match Function Application and Operators -Matching function application, prefix operators, and infix operators in hints are all done in the same way as how you'd write it in F# e.g. +Matching function application, prefix operators, and infix operators in hints are all done in the same way as how you'd write it in F# e.g.: [lang=hint] not true ===> false diff --git a/docs/content/how-tos/rules/FL0066.md b/docs/content/how-tos/rules/FL0066.md index 5af096213..71a37d86a 100644 --- a/docs/content/how-tos/rules/FL0066.md +++ b/docs/content/how-tos/rules/FL0066.md @@ -32,5 +32,5 @@ Use non-partial function or pattern matching. } } -* *allowedPartials* - list of strings representing partial functions to allow (e.g. `"List.tryFind"`) -* *additionalPartials* - list of strings representing additional partial functions to disallow +* *allowedPartials* - list of strings representing partial functions to allow (e.g. `"List.tryFind"`). +* *additionalPartials* - list of strings representing additional partial functions to disallow. diff --git a/docs/content/how-tos/rules/FL0067.md b/docs/content/how-tos/rules/FL0067.md index 8e49f0743..7890a50b3 100644 --- a/docs/content/how-tos/rules/FL0067.md +++ b/docs/content/how-tos/rules/FL0067.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0068.md b/docs/content/how-tos/rules/FL0068.md index 1fec618be..a9b7e1437 100644 --- a/docs/content/how-tos/rules/FL0068.md +++ b/docs/content/how-tos/rules/FL0068.md @@ -18,7 +18,7 @@ Consistency aides readability. ## How To Fix -Update the internal value's naming to be consistent with the rules you have specified +Update the internal value's naming to be consistent with the rules you have specified. ## Rule Settings @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0069.md b/docs/content/how-tos/rules/FL0069.md index de8455875..199bcf119 100644 --- a/docs/content/how-tos/rules/FL0069.md +++ b/docs/content/how-tos/rules/FL0069.md @@ -18,7 +18,7 @@ Consistency aides readability. ## How To Fix -Update the generic type naming to be consistent with the rules you have specified +Update the generic type naming to be consistent with the rules you have specified. ## Rule Settings @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers ("AllowPrefix", "AllowAny", or "None") +* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0086.md b/docs/content/how-tos/rules/FL0086.md index 30af8dc5b..4a5c77117 100644 --- a/docs/content/how-tos/rules/FL0086.md +++ b/docs/content/how-tos/rules/FL0086.md @@ -10,15 +10,15 @@ hide_menu: true ## Cause -A named pattern is used just to be compared in the guard against a constant expression e.g. `match something with | bar when bar = "baz" -> ()` +A named pattern is used just to be compared in the guard against a constant expression e.g. `match something with | bar when bar = "baz" -> ()`. ## Rationale -The named pattern can be changed to an as pattern that uses a constant pattern, improving the pattern matching exhaustiveness check +The named pattern can be changed to an as pattern that uses a constant pattern, improving the pattern matching exhaustiveness check. ## How To Fix -Remove the guard and replace the named pattern with the as pattern using a constant pattern, e.g. change `match something with | bar when bar = "baz" -> ()` to `match something with | "baz" as bar -> ()` +Remove the guard and replace the named pattern with the as pattern using a constant pattern, e.g. change `match something with | bar when bar = "baz" -> ()` to `match something with | "baz" as bar -> ()`. ## Rule Settings From 5eaf4adaa9b934788f96b595c586bb08b1661734 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Thu, 7 Aug 2025 17:44:24 +0800 Subject: [PATCH 2/9] Core: new "AllowInfix" enum for underscores This paves the way for allowing people to use MACRO_CASE or snake_case in their configurations. --- src/FSharpLint.Core/Framework/Rules.fs | 1 + .../Rules/Conventions/Naming/NamingHelper.fs | 32 +++++++---- src/FSharpLint.Core/Text.resx | 3 + .../Rules/Conventions/Naming/LiteralNames.fs | 55 +++++++++++++++++++ 4 files changed, 81 insertions(+), 10 deletions(-) diff --git a/src/FSharpLint.Core/Framework/Rules.fs b/src/FSharpLint.Core/Framework/Rules.fs index 2be7d3398..b550898a1 100644 --- a/src/FSharpLint.Core/Framework/Rules.fs +++ b/src/FSharpLint.Core/Framework/Rules.fs @@ -58,6 +58,7 @@ type NamingUnderscores = | None = 0 | AllowPrefix = 1 | AllowAny = 2 + | AllowInfix = 3 type NamingConfig = { Naming:NamingCase option diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs index 91a685000..76d327bde 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs @@ -24,6 +24,10 @@ module QuickFixes = let toText = prefixingUnderscores + ident.idText.Replace("_", String.Empty) Some { FromText = ident.idText; FromRange = ident.idRange; ToText = toText }) + let removePrefixingAndSuffixingUnderscores (ident:Ident) = lazy( + let toText = ident.idText.Trim '_' + Some { FromText = ident.idText; FromRange = ident.idRange; ToText = toText }) + let addPrefix prefix (ident:Ident) = lazy( Some { FromText = ident.idText; FromRange = ident.idRange; ToText = prefix + ident.idText }) @@ -83,12 +87,17 @@ let private camelCaseRule (identifier:string) = if not (isCamelCase identifier) then Some "RulesNamingConventionsCamelCaseError" else None -let private underscoreRule allowPrefix (identifier:string) = - if allowPrefix && identifier.TrimStart('_').Contains("_") then - Some "RulesNamingConventionsUnderscoreError" - else if not allowPrefix && identifier.Contains("_") then - Some "RulesNamingConventionsUnderscoreError" - else +let private underscoreRule (underscoreMode: NamingUnderscores) (identifier:string) = + let errorKeyToRemoveUnderscores = "RulesNamingConventionsUnderscoreError" + let errorKeyToRemoveLeadingOrTrailingUnderscores = "RulesNamingConventionsNoInfixUnderscoreError" + match underscoreMode with + | NamingUnderscores.AllowPrefix when identifier.TrimStart('_').Contains '_' -> + Some errorKeyToRemoveUnderscores + | NamingUnderscores.None when identifier.Contains '_' -> + Some errorKeyToRemoveUnderscores + | NamingUnderscores.AllowInfix when (identifier.StartsWith '_' || identifier.EndsWith '_') -> + Some errorKeyToRemoveLeadingOrTrailingUnderscores + | _ -> None let private prefixRule (prefix:string) (identifier:string) = @@ -120,12 +129,15 @@ let private checkIdentifierPart (config:NamingConfig) (identifier:Ident) (idText let underscoresError = match config.Underscores with - | Some NamingUnderscores.None -> - underscoreRule false idText + | Some (NamingUnderscores.None as nuCfg) -> + underscoreRule nuCfg idText |> Option.map (formatError >> tryAddFix QuickFixes.removeAllUnderscores) - | Some NamingUnderscores.AllowPrefix -> - underscoreRule true idText + | Some (NamingUnderscores.AllowPrefix as nuCfg) -> + underscoreRule nuCfg idText |> Option.map (formatError >> tryAddFix QuickFixes.removeNonPrefixingUnderscores) + | Some (NamingUnderscores.AllowInfix as nuCfg) -> + underscoreRule nuCfg idText + |> Option.map (formatError >> tryAddFix QuickFixes.removePrefixingAndSuffixingUnderscores) | _ -> None let prefixError = diff --git a/src/FSharpLint.Core/Text.resx b/src/FSharpLint.Core/Text.resx index 17681b968..c53d37814 100644 --- a/src/FSharpLint.Core/Text.resx +++ b/src/FSharpLint.Core/Text.resx @@ -174,6 +174,9 @@ Consider changing `{0}` to remove any underscores. + + Consider removing any leading or trailing underscore from `{0}`. + Consider using a longer name, as it is currently too short. diff --git a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs index 0304628ff..1e7877da5 100644 --- a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs +++ b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs @@ -10,6 +10,7 @@ let config = Underscores = Some NamingUnderscores.None Prefix = None Suffix = None } + [] type TestConventionsLiteralNames() = inherit TestAstNodeRuleBase.TestAstNodeRuleBase(LiteralNames.rule config) @@ -69,3 +70,57 @@ let cat = 5 Assert.IsTrue(this.ErrorExistsAt(5, 4)) +let infixConfig = + { NamingConfig.Naming = Some NamingCase.PascalCase + Underscores = Some NamingUnderscores.AllowInfix + Prefix = None + Suffix = None } + +[] +type TestConventionsLiteralNamesInfix() = + inherit TestAstNodeRuleBase.TestAstNodeRuleBase(LiteralNames.rule infixConfig) + + [] + member this.LiteralIsInfixUnderscore() = + this.Parse """ +module Program + +[] +let Super_Cat = 5 +""" + + this.AssertNoWarnings() + + [] + member this.LiteralIsUnderscorePrefix() = + this.Parse """ +module Program + +[] +let _Cat = 5 +""" + + Assert.IsTrue(this.ErrorExistsOnLine 5) + + [] + member this.LiteralIsUnderscoreSuffix() = + this.Parse """ +module Program + +[] +let Cat_ = 5 +""" + + Assert.IsTrue(this.ErrorExistsOnLine 5) + + [] + member this.LiteralIsNoUnderscore() = + this.Parse """ +module Program + +[] +let SuperCat = 5 +""" + + this.AssertNoWarnings() + From dca8cf4869ab7af004ce9877e01362cde3c1a13e Mon Sep 17 00:00:00 2001 From: webwarrior-ws Date: Thu, 14 Aug 2025 19:58:53 +0200 Subject: [PATCH 3/9] LiteralNames: fixed rule Added another case to getLiteralIdents because F# compiler can produce different AST for similar code. --- src/FSharpLint.Core/Rules/Conventions/Naming/LiteralNames.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/LiteralNames.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/LiteralNames.fs index 2d8df210c..632847507 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/LiteralNames.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/LiteralNames.fs @@ -12,6 +12,8 @@ let private getIdentifiers (args:AstNodeRuleParams) = let rec getLiteralIdents = function | SynPat.Named(SynIdent(identifier, _), _, _, _) -> Array.singleton (identifier, identifier.idText, None) + | SynPat.LongIdent(SynLongIdent([identifier], _, _), _, _, _, _, _) -> + Array.singleton (identifier, identifier.idText, None) | SynPat.Paren(pat, _) -> getLiteralIdents pat | _ -> Array.empty From d842850eeeaa64007533c0f6b01e183f84eac7e4 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 12 Aug 2025 13:19:14 +0200 Subject: [PATCH 4/9] Core: add new all{upper,lower}case styles Also modified a test to make sure they work. Co-authored-by: webwarrior-ws --- src/FSharpLint.Core/Framework/Rules.fs | 2 ++ .../Rules/Conventions/Naming/NamingHelper.fs | 31 +++++++++++++++++++ src/FSharpLint.Core/Text.resx | 6 ++++ .../Rules/Conventions/Naming/LiteralNames.fs | 10 +++--- 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/FSharpLint.Core/Framework/Rules.fs b/src/FSharpLint.Core/Framework/Rules.fs index b550898a1..2877244ab 100644 --- a/src/FSharpLint.Core/Framework/Rules.fs +++ b/src/FSharpLint.Core/Framework/Rules.fs @@ -53,6 +53,8 @@ type AstNodeRuleConfig = type NamingCase = | PascalCase = 0 | CamelCase = 1 + | AllLowercase = 2 + | AllUppercase = 3 type NamingUnderscores = | None = 0 diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs index 76d327bde..b18bec861 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs @@ -52,6 +52,16 @@ module QuickFixes = let camelCaseIdent = mapFirstChar Char.ToLower ident.idText Some { FromText = ident.idText; FromRange = ident.idRange; ToText = camelCaseIdent }) + let toAllLowercase (ident:Ident) = lazy( + let newIdent = ident.idText.ToLower() + //TODO: in case Underscores=AllowAny or AllowInfix, and ident is PascalCase or CamelCase, try to inject them when case changes + Some { FromText = ident.idText; FromRange = ident.idRange; ToText = newIdent }) + + let toAllUppercase (ident:Ident) = lazy( + let newIdent = ident.idText.ToUpper() + //TODO: in case Underscores=AllowAny or AllowInfix, and ident is PascalCase or CamelCase, try to inject them when case changes + Some { FromText = ident.idText; FromRange = ident.idRange; ToText = newIdent }) + [] let private NumberOfExpectedBackticks = 4 @@ -79,6 +89,12 @@ let isCamelCase (identifier:string) = if withoutUnderscorePrefix.Length = 0 then true else Char.IsLower withoutUnderscorePrefix.[0] +let isAllLowercase (identifier:string) = + Seq.forall (fun char -> Char.IsLower char || (not <| Char.IsLetter char)) identifier + +let isAllUppercase (identifier:string) = + Seq.forall (fun char -> Char.IsUpper char || (not <| Char.IsLetter char)) identifier + let private pascalCaseRule (identifier:string) = if not (isPascalCase identifier) then Some "RulesNamingConventionsPascalCaseError" else None @@ -87,6 +103,15 @@ let private camelCaseRule (identifier:string) = if not (isCamelCase identifier) then Some "RulesNamingConventionsCamelCaseError" else None +let private uppercaseRule (identifier:string) = + if not (isAllUppercase identifier) then Some "RulesNamingConventionsUppercaseError" + else None + +let private lowercaseRule (identifier:string) = + if not (isAllLowercase identifier) then Some "RulesNamingConventionsLowercaseError" + else None + + let private underscoreRule (underscoreMode: NamingUnderscores) (identifier:string) = let errorKeyToRemoveUnderscores = "RulesNamingConventionsUnderscoreError" let errorKeyToRemoveLeadingOrTrailingUnderscores = "RulesNamingConventionsNoInfixUnderscoreError" @@ -125,6 +150,12 @@ let private checkIdentifierPart (config:NamingConfig) (identifier:Ident) (idText | Some NamingCase.CamelCase -> camelCaseRule idText |> Option.map (formatError >> tryAddFix QuickFixes.toCamelCase) + | Some NamingCase.AllLowercase -> + lowercaseRule idText + |> Option.map (formatError >> tryAddFix QuickFixes.toAllLowercase) + | Some NamingCase.AllUppercase -> + uppercaseRule idText + |> Option.map (formatError >> tryAddFix QuickFixes.toAllUppercase) | _ -> None let underscoresError = diff --git a/src/FSharpLint.Core/Text.resx b/src/FSharpLint.Core/Text.resx index c53d37814..642d9b6dc 100644 --- a/src/FSharpLint.Core/Text.resx +++ b/src/FSharpLint.Core/Text.resx @@ -177,6 +177,12 @@ Consider removing any leading or trailing underscore from `{0}`. + + Consider changing `{0}` to uppercase. + + + Consider changing `{0}` to lowercase. + Consider using a longer name, as it is currently too short. diff --git a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs index 1e7877da5..2cc8e9f1e 100644 --- a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs +++ b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs @@ -71,7 +71,7 @@ let cat = 5 Assert.IsTrue(this.ErrorExistsAt(5, 4)) let infixConfig = - { NamingConfig.Naming = Some NamingCase.PascalCase + { NamingConfig.Naming = Some NamingCase.AllLowercase Underscores = Some NamingUnderscores.AllowInfix Prefix = None Suffix = None } @@ -86,7 +86,7 @@ type TestConventionsLiteralNamesInfix() = module Program [] -let Super_Cat = 5 +let super_cat = 5 """ this.AssertNoWarnings() @@ -97,7 +97,7 @@ let Super_Cat = 5 module Program [] -let _Cat = 5 +let _cat = 5 """ Assert.IsTrue(this.ErrorExistsOnLine 5) @@ -108,7 +108,7 @@ let _Cat = 5 module Program [] -let Cat_ = 5 +let cat_ = 5 """ Assert.IsTrue(this.ErrorExistsOnLine 5) @@ -122,5 +122,5 @@ module Program let SuperCat = 5 """ - this.AssertNoWarnings() + Assert.IsTrue(this.ErrorExistsOnLine 5) From 31afc67807d8a5b718a2243e36fd4882f9c5f263 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 12 Aug 2025 14:30:02 +0200 Subject: [PATCH 5/9] Tests: add quickfix from camelCase to snake_case --- .../Rules/Conventions/Naming/LiteralNames.fs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs index 2cc8e9f1e..38395e50f 100644 --- a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs +++ b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs @@ -124,3 +124,24 @@ let SuperCat = 5 Assert.IsTrue(this.ErrorExistsOnLine 5) + [] + member this.SuggestedFix() = + let source = """ +module Program + +[] +let superCat = 5 +""" + let expected = """ +module Program + +[] +let super_cat = 5 +""" + this.Parse source + + Assert.IsTrue(this.ErrorExistsOnLine 5) + + let result = this.ApplyQuickFix source + + Assert.AreEqual(expected, result) From 939e71dc27b1194a7a40180f59988ca0cf660a79 Mon Sep 17 00:00:00 2001 From: webwarrior-ws Date: Tue, 12 Aug 2025 15:12:21 +0200 Subject: [PATCH 6/9] Core: implement proper underscore AllowInfix injection In the case the user wants quick fixes to convert {camel,pascal}case to snake_case or MACRO_CASE, we need to inject underscores when case changes. This commit makes the previous added test pass. --- .../Rules/Conventions/Naming/NamingHelper.fs | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs index b18bec861..43273b292 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs @@ -1,6 +1,7 @@ module FSharpLint.Rules.Helper.Naming open System +open System.Text open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharpLint.Framework @@ -52,15 +53,33 @@ module QuickFixes = let camelCaseIdent = mapFirstChar Char.ToLower ident.idText Some { FromText = ident.idText; FromRange = ident.idRange; ToText = camelCaseIdent }) - let toAllLowercase (ident:Ident) = lazy( - let newIdent = ident.idText.ToLower() - //TODO: in case Underscores=AllowAny or AllowInfix, and ident is PascalCase or CamelCase, try to inject them when case changes - Some { FromText = ident.idText; FromRange = ident.idRange; ToText = newIdent }) - - let toAllUppercase (ident:Ident) = lazy( - let newIdent = ident.idText.ToUpper() - //TODO: in case Underscores=AllowAny or AllowInfix, and ident is PascalCase or CamelCase, try to inject them when case changes - Some { FromText = ident.idText; FromRange = ident.idRange; ToText = newIdent }) + let splitByCaseChange (name: string) : seq = + let builder = System.Text.StringBuilder() + seq { + let isUppercase = Char.IsUpper name.[0] + for char in name do + if isUppercase <> Char.IsUpper char then + yield builder.ToString() + builder.Clear() |> ignore + builder.Append char |> ignore + if builder.Length > 0 then + yield builder.ToString() + } + + let private convertAllToCase (caseMapping: string -> string) (underscoresConfig: Option) (ident:Ident) = + lazy( + let newIdent = + match underscoresConfig with + | Some NamingUnderscores.AllowAny | Some NamingUnderscores.AllowInfix -> + let parts = splitByCaseChange ident.idText |> Seq.map caseMapping + String.Join('_', parts) + | _ -> caseMapping ident.idText + Some { FromText = ident.idText; FromRange = ident.idRange; ToText = newIdent } + ) + + let toAllLowercase = convertAllToCase (fun part -> part.ToLower()) + + let toAllUppercase = convertAllToCase (fun part -> part.ToUpper()) [] let private NumberOfExpectedBackticks = 4 @@ -152,10 +171,10 @@ let private checkIdentifierPart (config:NamingConfig) (identifier:Ident) (idText |> Option.map (formatError >> tryAddFix QuickFixes.toCamelCase) | Some NamingCase.AllLowercase -> lowercaseRule idText - |> Option.map (formatError >> tryAddFix QuickFixes.toAllLowercase) + |> Option.map (formatError >> tryAddFix (QuickFixes.toAllLowercase config.Underscores)) | Some NamingCase.AllUppercase -> uppercaseRule idText - |> Option.map (formatError >> tryAddFix QuickFixes.toAllUppercase) + |> Option.map (formatError >> tryAddFix (QuickFixes.toAllUppercase config.Underscores)) | _ -> None let underscoresError = From 871174d756910557e54dac27e9e1f7236bd33509 Mon Sep 17 00:00:00 2001 From: webwarrior-ws Date: Wed, 13 Aug 2025 10:15:59 +0200 Subject: [PATCH 7/9] Tests(LiteralNames): extra more complex test --- .../Rules/Conventions/Naming/LiteralNames.fs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs index 38395e50f..29931c5e9 100644 --- a/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs +++ b/tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/LiteralNames.fs @@ -145,3 +145,25 @@ let super_cat = 5 let result = this.ApplyQuickFix source Assert.AreEqual(expected, result) + + [] + member this.SuggestedFixForComplexName() = + let source = """ +module Program + +[] +let SuperCatWith1Number = 5 +""" + let expected = """ +module Program + +[] +let super_cat_with_1_number = 5 +""" + this.Parse source + + Assert.IsTrue(this.ErrorExistsOnLine 5) + + let result = this.ApplyQuickFix source + + Assert.AreEqual(expected, result) From 1974a4b085bc3cc5b2414e569b8e78f5c6fdd93e Mon Sep 17 00:00:00 2001 From: webwarrior-ws Date: Thu, 14 Aug 2025 20:52:37 +0200 Subject: [PATCH 8/9] Core(Naming): make last test pass Regarding splitByCaseChange: a more complex case. --- .../Rules/Conventions/Naming/NamingHelper.fs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs index 43273b292..8e8fd6f4e 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs @@ -1,7 +1,6 @@ module FSharpLint.Rules.Helper.Naming open System -open System.Text open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharpLint.Framework @@ -54,16 +53,17 @@ module QuickFixes = Some { FromText = ident.idText; FromRange = ident.idRange; ToText = camelCaseIdent }) let splitByCaseChange (name: string) : seq = - let builder = System.Text.StringBuilder() + let partitionPoints = + seq { + yield 0 + for (index, (current, next)) in name |> Seq.pairwise |> Seq.indexed do + if (Char.IsUpper next || not (Char.IsLetter next)) && not (Char.IsUpper current) then + yield index + 1 + yield name.Length + } seq { - let isUppercase = Char.IsUpper name.[0] - for char in name do - if isUppercase <> Char.IsUpper char then - yield builder.ToString() - builder.Clear() |> ignore - builder.Append char |> ignore - if builder.Length > 0 then - yield builder.ToString() + for (start, finish) in Seq.pairwise partitionPoints do + yield name.Substring(start, finish - start) } let private convertAllToCase (caseMapping: string -> string) (underscoresConfig: Option) (ident:Ident) = From ff2bcec07291effe526a139bc233fde872a01263 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 12 Aug 2025 20:52:16 +0200 Subject: [PATCH 9/9] docs: include new AllowInfix & {Upper,Lower}case settings --- docs/content/how-tos/rules/FL0036.md | 4 ++-- docs/content/how-tos/rules/FL0037.md | 4 ++-- docs/content/how-tos/rules/FL0038.md | 4 ++-- docs/content/how-tos/rules/FL0039.md | 4 ++-- docs/content/how-tos/rules/FL0040.md | 4 ++-- docs/content/how-tos/rules/FL0041.md | 4 ++-- docs/content/how-tos/rules/FL0042.md | 4 ++-- docs/content/how-tos/rules/FL0043.md | 4 ++-- docs/content/how-tos/rules/FL0044.md | 4 ++-- docs/content/how-tos/rules/FL0045.md | 4 ++-- docs/content/how-tos/rules/FL0046.md | 4 ++-- docs/content/how-tos/rules/FL0047.md | 4 ++-- docs/content/how-tos/rules/FL0048.md | 4 ++-- docs/content/how-tos/rules/FL0049.md | 4 ++-- docs/content/how-tos/rules/FL0050.md | 4 ++-- docs/content/how-tos/rules/FL0067.md | 4 ++-- docs/content/how-tos/rules/FL0068.md | 4 ++-- docs/content/how-tos/rules/FL0069.md | 4 ++-- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/content/how-tos/rules/FL0036.md b/docs/content/how-tos/rules/FL0036.md index 2770077ef..7c009cb59 100644 --- a/docs/content/how-tos/rules/FL0036.md +++ b/docs/content/how-tos/rules/FL0036.md @@ -33,7 +33,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers ("PascalCase" or "CamelCase") -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0037.md b/docs/content/how-tos/rules/FL0037.md index e77f6e13a..ca620522c 100644 --- a/docs/content/how-tos/rules/FL0037.md +++ b/docs/content/how-tos/rules/FL0037.md @@ -33,7 +33,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0038.md b/docs/content/how-tos/rules/FL0038.md index aca3b5972..bdec102a9 100644 --- a/docs/content/how-tos/rules/FL0038.md +++ b/docs/content/how-tos/rules/FL0038.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0039.md b/docs/content/how-tos/rules/FL0039.md index 3a996ed9e..6247721a8 100644 --- a/docs/content/how-tos/rules/FL0039.md +++ b/docs/content/how-tos/rules/FL0039.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0040.md b/docs/content/how-tos/rules/FL0040.md index 3de670ef5..38f5bddbe 100644 --- a/docs/content/how-tos/rules/FL0040.md +++ b/docs/content/how-tos/rules/FL0040.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0041.md b/docs/content/how-tos/rules/FL0041.md index ece7d15c4..39ba532ce 100644 --- a/docs/content/how-tos/rules/FL0041.md +++ b/docs/content/how-tos/rules/FL0041.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0042.md b/docs/content/how-tos/rules/FL0042.md index 51315af3d..1978fa12f 100644 --- a/docs/content/how-tos/rules/FL0042.md +++ b/docs/content/how-tos/rules/FL0042.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0043.md b/docs/content/how-tos/rules/FL0043.md index 85ea3faaf..db47e6912 100644 --- a/docs/content/how-tos/rules/FL0043.md +++ b/docs/content/how-tos/rules/FL0043.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0044.md b/docs/content/how-tos/rules/FL0044.md index 1c6892e4e..ec51e5054 100644 --- a/docs/content/how-tos/rules/FL0044.md +++ b/docs/content/how-tos/rules/FL0044.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0045.md b/docs/content/how-tos/rules/FL0045.md index f8274009f..1ebe455a4 100644 --- a/docs/content/how-tos/rules/FL0045.md +++ b/docs/content/how-tos/rules/FL0045.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0046.md b/docs/content/how-tos/rules/FL0046.md index 2c1d7280f..bd4346d4c 100644 --- a/docs/content/how-tos/rules/FL0046.md +++ b/docs/content/how-tos/rules/FL0046.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0047.md b/docs/content/how-tos/rules/FL0047.md index ed8e1f066..29f006f46 100644 --- a/docs/content/how-tos/rules/FL0047.md +++ b/docs/content/how-tos/rules/FL0047.md @@ -31,7 +31,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0048.md b/docs/content/how-tos/rules/FL0048.md index 2bdbe4c21..5b79e38cc 100644 --- a/docs/content/how-tos/rules/FL0048.md +++ b/docs/content/how-tos/rules/FL0048.md @@ -32,7 +32,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0049.md b/docs/content/how-tos/rules/FL0049.md index 0ed7b8946..7fb59eff9 100644 --- a/docs/content/how-tos/rules/FL0049.md +++ b/docs/content/how-tos/rules/FL0049.md @@ -31,7 +31,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0050.md b/docs/content/how-tos/rules/FL0050.md index 0a0410146..9f11a5d95 100644 --- a/docs/content/how-tos/rules/FL0050.md +++ b/docs/content/how-tos/rules/FL0050.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0067.md b/docs/content/how-tos/rules/FL0067.md index 7890a50b3..8f21caa22 100644 --- a/docs/content/how-tos/rules/FL0067.md +++ b/docs/content/how-tos/rules/FL0067.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0068.md b/docs/content/how-tos/rules/FL0068.md index a9b7e1437..c6723bde0 100644 --- a/docs/content/how-tos/rules/FL0068.md +++ b/docs/content/how-tos/rules/FL0068.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers. diff --git a/docs/content/how-tos/rules/FL0069.md b/docs/content/how-tos/rules/FL0069.md index 199bcf119..6400a5ab6 100644 --- a/docs/content/how-tos/rules/FL0069.md +++ b/docs/content/how-tos/rules/FL0069.md @@ -34,7 +34,7 @@ Note, any of the settings below can be omitted and will not be checked. } } -* *naming* - expected casing of the identifiers: "PascalCase" or "CamelCase". -* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowAny", or "None". +* *naming* - expected casing of the identifiers: "PascalCase", "CamelCase", "AllUppercase", or "AllLowercase". +* *underscores* - if underscores are allowed in the identifiers: "AllowPrefix", "AllowInfix", "AllowAny", or "None". * *prefix* - prefix string expected on the front of the identifiers. * *suffix* - suffix string expected on the end of the identifiers.