diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 15ad7d59d..aaff0dce9 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -3,6 +3,7 @@ # that they are unlikely to be what you are interested in when blaming. # Like formatting with Fantomas # https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view +# NOTE: order is oldest commits go at the top, newest ones at the bottom # Console,Core,Tests: fix FSharpLint warning (Fixing the warning for AvoidTooShortNames rule.) e9410e83af1de4d76230b0e8d44ae6a99fac6d7b @@ -12,3 +13,6 @@ e9410e83af1de4d76230b0e8d44ae6a99fac6d7b # README,Core: reviewed rules categories & their descriptions 2ab7b6ad9b5ad63f1934c1476ae5965022bb49f9 + +# Rename FL0094 +b33fd78a73160e82cdf7c7ce9313b33d5f630a06 diff --git a/docs/content/how-tos/rule-configuration.md b/docs/content/how-tos/rule-configuration.md index 231943b04..89dec7253 100644 --- a/docs/content/how-tos/rule-configuration.md +++ b/docs/content/how-tos/rule-configuration.md @@ -134,4 +134,4 @@ The following rules can be specified for linting. - [FavourNestedFunctions (FL0091)](rules/FL0091.html) - [DisallowShadowing (FL0092)](rules/FL0092.html) - [DiscourageStringInterpolationWithStringFormat (FL0093)](rules/FL0093.html) -- [FavourNamesInDUMembers (FL0094)](rules/FL0094.html) +- [FavourNamedMembers (FL0094)](rules/FL0094.html) diff --git a/docs/content/how-tos/rules/FL0094.md b/docs/content/how-tos/rules/FL0094.md index 4e18d6f60..69af13b83 100644 --- a/docs/content/how-tos/rules/FL0094.md +++ b/docs/content/how-tos/rules/FL0094.md @@ -4,7 +4,7 @@ category: how-to hide_menu: true --- -# FavourNamesInDUMembers (FL0094) +# FavourNamedMembers (FL0094) *Introduced in `0.26.12`* @@ -48,7 +48,7 @@ Add a field name to the discriminated union case field. ## Rule Settings { - "favourNamesInDUMembers": { + "favourNamedMembers": { "enabled": false } } diff --git a/src/FSharpLint.Core/Application/Configuration.fs b/src/FSharpLint.Core/Application/Configuration.fs index dc6fffde4..b3b1cbede 100644 --- a/src/FSharpLint.Core/Application/Configuration.fs +++ b/src/FSharpLint.Core/Application/Configuration.fs @@ -388,7 +388,7 @@ type ConventionsConfig = favourNestedFunctions:EnabledConfig option disallowShadowing:EnabledConfig option discourageStringInterpolationWithStringFormat:EnabledConfig option - favourNamesInDUMembers:EnabledConfig option } + favourNamedMembers:EnabledConfig option } with member this.Flatten() = Array.concat @@ -419,7 +419,7 @@ with this.favourNestedFunctions |> Option.bind (constructRuleIfEnabled FavourNestedFunctions.rule) |> Option.toArray this.disallowShadowing |> Option.bind (constructRuleIfEnabled DisallowShadowing.rule) |> Option.toArray this.discourageStringInterpolationWithStringFormat |> Option.bind (constructRuleIfEnabled DiscourageStringInterpolationWithStringFormat.rule) |> Option.toArray - this.favourNamesInDUMembers |> Option.bind (constructRuleIfEnabled FavourNamesInDUMembers.rule) |> Option.toArray + this.favourNamedMembers |> Option.bind (constructRuleIfEnabled FavourNamedMembers.rule) |> Option.toArray |] [] @@ -564,7 +564,7 @@ type Configuration = FavourNestedFunctions:EnabledConfig option DisallowShadowing:EnabledConfig option DiscourageStringInterpolationWithStringFormat:EnabledConfig option - FavourNamesInDUMembers:EnabledConfig option } + FavourNamedMembers:EnabledConfig option } with // Method Zero is too big but can't be split into parts because it returns a record // and it requires all fields to be set. @@ -673,7 +673,7 @@ with FavourNestedFunctions = None DisallowShadowing = None DiscourageStringInterpolationWithStringFormat = None - FavourNamesInDUMembers = None + FavourNamedMembers = None } // fsharplint:enable MaxLinesInMember @@ -884,7 +884,7 @@ let flattenConfig (config:Configuration) = config.FavourNestedFunctions |> Option.bind (constructRuleIfEnabled FavourNestedFunctions.rule) config.DisallowShadowing |> Option.bind (constructRuleIfEnabled DisallowShadowing.rule) config.DiscourageStringInterpolationWithStringFormat |> Option.bind (constructRuleIfEnabled DiscourageStringInterpolationWithStringFormat.rule) - config.FavourNamesInDUMembers |> Option.bind (constructRuleIfEnabled FavourNamesInDUMembers.rule) + config.FavourNamedMembers |> Option.bind (constructRuleIfEnabled FavourNamedMembers.rule) |] findDeprecation config deprecatedAllRules allRules diff --git a/src/FSharpLint.Core/FSharpLint.Core.fsproj b/src/FSharpLint.Core/FSharpLint.Core.fsproj index a90ae0bde..cbcd392f5 100644 --- a/src/FSharpLint.Core/FSharpLint.Core.fsproj +++ b/src/FSharpLint.Core/FSharpLint.Core.fsproj @@ -63,7 +63,7 @@ - + diff --git a/src/FSharpLint.Core/Rules/Conventions/FavourNamesInDUMembers.fs b/src/FSharpLint.Core/Rules/Conventions/FavourNamedMembers.fs similarity index 85% rename from src/FSharpLint.Core/Rules/Conventions/FavourNamesInDUMembers.fs rename to src/FSharpLint.Core/Rules/Conventions/FavourNamedMembers.fs index 0d02ab252..afd4db41e 100644 --- a/src/FSharpLint.Core/Rules/Conventions/FavourNamesInDUMembers.fs +++ b/src/FSharpLint.Core/Rules/Conventions/FavourNamedMembers.fs @@ -1,4 +1,4 @@ -module FSharpLint.Rules.FavourNamesInDUMembers +module FSharpLint.Rules.FavourNamedMembers open System open FSharpLint.Framework @@ -12,7 +12,7 @@ let runner (args: AstNodeRuleParams) = Array.singleton { Range = range - Message = Resources.GetString "RulesFavourNamesInDUMembers" + Message = Resources.GetString "RulesFavourNamedMembers" SuggestedFix = None TypeChecks = List.Empty } @@ -45,8 +45,8 @@ let runner (args: AstNodeRuleParams) = let rule = AstNodeRule { - Name = "FavourNamesInDUMembers" - Identifier = Identifiers.FavourNamesInDUMembers + Name = "FavourNamedMembers" + Identifier = Identifiers.FavourNamedMembers RuleConfig = { AstNodeRuleConfig.Runner = runner diff --git a/src/FSharpLint.Core/Rules/Identifiers.fs b/src/FSharpLint.Core/Rules/Identifiers.fs index 02ae6f654..7fda80df2 100644 --- a/src/FSharpLint.Core/Rules/Identifiers.fs +++ b/src/FSharpLint.Core/Rules/Identifiers.fs @@ -98,4 +98,4 @@ let NoAsyncRunSynchronouslyInLibrary = identifier 90 let FavourNestedFunctions = identifier 91 let DisallowShadowing = identifier 92 let DiscourageStringInterpolationWithStringFormat = identifier 93 -let FavourNamesInDUMembers = identifier 94 +let FavourNamedMembers = identifier 94 diff --git a/src/FSharpLint.Core/Text.resx b/src/FSharpLint.Core/Text.resx index b96008885..a21d042f7 100644 --- a/src/FSharpLint.Core/Text.resx +++ b/src/FSharpLint.Core/Text.resx @@ -405,7 +405,7 @@ Use sprintf instead of String.Format. - + Use named discriminated union fields. diff --git a/src/FSharpLint.Core/fsharplint.json b/src/FSharpLint.Core/fsharplint.json index 9568a8fb7..a1cb20331 100644 --- a/src/FSharpLint.Core/fsharplint.json +++ b/src/FSharpLint.Core/fsharplint.json @@ -347,7 +347,7 @@ "discourageStringInterpolationWithStringFormat": { "enabled": false }, - "favourNamesInDUMembers": { "enabled": false }, + "favourNamedMembers": { "enabled": false }, "hints": { "add": [ "not (a = b) ===> a <> b", diff --git a/tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj b/tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj index 5db91642d..5981fe587 100644 --- a/tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj +++ b/tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj @@ -53,7 +53,7 @@ - + diff --git a/tests/FSharpLint.Core.Tests/Rules/Conventions/FavourNamesInDUMembers.fs b/tests/FSharpLint.Core.Tests/Rules/Conventions/FavourNamedMembers.fs similarity index 87% rename from tests/FSharpLint.Core.Tests/Rules/Conventions/FavourNamesInDUMembers.fs rename to tests/FSharpLint.Core.Tests/Rules/Conventions/FavourNamedMembers.fs index 34a44deab..b15e750e0 100644 --- a/tests/FSharpLint.Core.Tests/Rules/Conventions/FavourNamesInDUMembers.fs +++ b/tests/FSharpLint.Core.Tests/Rules/Conventions/FavourNamedMembers.fs @@ -1,4 +1,4 @@ -module FSharpLint.Core.Tests.Rules.Conventions.FavourNamesInDUMembers +module FSharpLint.Core.Tests.Rules.Conventions.FavourNamedMembers open NUnit.Framework @@ -6,8 +6,8 @@ open FSharpLint.Rules open FSharpLint.Core.Tests [] -type TestFavourNamesInDUMembers() = - inherit TestAstNodeRuleBase.TestAstNodeRuleBase(FavourNamesInDUMembers.rule) +type TestFavourNamedMembers() = + inherit TestAstNodeRuleBase.TestAstNodeRuleBase(FavourNamedMembers.rule) [] member this.``Should produce error for DU with unnamed fields``() =