Skip to content

Commit 90ea90e

Browse files
committed
FavourBasicControlFlow: rename to RecommendIfElseConstructOverMatch
1 parent 41c8e17 commit 90ea90e

10 files changed

Lines changed: 20 additions & 20 deletions

File tree

docs/content/how-tos/rule-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ The following rules can be specified for linting.
134134
- [FavourNestedFunctions (FL0091)](rules/FL0091.html)
135135
- [DisallowShadowing (FL0092)](rules/FL0092.html)
136136
- [DiscourageStringInterpolationWithStringFormat (FL0093)](rules/FL0093.html)
137-
- [FavourBasicControlFlow (FL0094)](rules/FL0094.html)
137+
- [RecommendIfElseConstructOverMatch (FL0094)](rules/FL0094.html)

docs/content/how-tos/rules/FL0094.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ category: how-to
44
hide_menu: true
55
---
66

7-
# FavourBasicControlFlow (FL0094)
7+
# RecommendIfElseConstructOverMatch (FL0094)
88

99
*Introduced in `0.26.12`*
1010

@@ -24,7 +24,7 @@ Use if-else construct instead of match clause.
2424
## Rule Settings
2525

2626
{
27-
"favourBasicControlFlow": {
27+
"recommendIfElseConstructOverMatch": {
2828
"enabled": false
2929
}
3030
}

src/FSharpLint.Core/Application/Configuration.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ type ConventionsConfig =
388388
favourNestedFunctions:EnabledConfig option
389389
disallowShadowing:EnabledConfig option
390390
discourageStringInterpolationWithStringFormat:EnabledConfig option
391-
favourBasicControlFlow:EnabledConfig option }
391+
recommendIfElseConstructOverMatch:EnabledConfig option }
392392
with
393393
member this.Flatten() =
394394
Array.concat
@@ -419,7 +419,7 @@ with
419419
this.favourNestedFunctions |> Option.bind (constructRuleIfEnabled FavourNestedFunctions.rule) |> Option.toArray
420420
this.disallowShadowing |> Option.bind (constructRuleIfEnabled DisallowShadowing.rule) |> Option.toArray
421421
this.discourageStringInterpolationWithStringFormat |> Option.bind (constructRuleIfEnabled DiscourageStringInterpolationWithStringFormat.rule) |> Option.toArray
422-
this.favourBasicControlFlow |> Option.bind (constructRuleIfEnabled FavourBasicControlFlow.rule) |> Option.toArray
422+
this.recommendIfElseConstructOverMatch |> Option.bind (constructRuleIfEnabled RecommendIfElseConstructOverMatch.rule) |> Option.toArray
423423
|]
424424

425425
[<Obsolete(ObsoleteMsg, ObsoleteWarnTreatAsError)>]
@@ -490,7 +490,7 @@ type Configuration =
490490
RedundantNewKeyword:EnabledConfig option
491491
FavourNonMutablePropertyInitialization:EnabledConfig option
492492
FavourReRaise:EnabledConfig option
493-
FavourBasicControlFlow:EnabledConfig option
493+
RecommendIfElseConstructOverMatch:EnabledConfig option
494494
FavourStaticEmptyFields:EnabledConfig option
495495
AsyncExceptionWithoutReturn:EnabledConfig option
496496
UnneededRecKeyword:EnabledConfig option
@@ -596,7 +596,7 @@ with
596596
RedundantNewKeyword = None
597597
FavourNonMutablePropertyInitialization = None
598598
FavourReRaise = None
599-
FavourBasicControlFlow = None
599+
RecommendIfElseConstructOverMatch = None
600600
FavourStaticEmptyFields = None
601601
AsyncExceptionWithoutReturn = None
602602
UnneededRecKeyword = None
@@ -880,7 +880,7 @@ let flattenConfig (config:Configuration) =
880880
config.FavourNestedFunctions |> Option.bind (constructRuleIfEnabled FavourNestedFunctions.rule)
881881
config.DisallowShadowing |> Option.bind (constructRuleIfEnabled DisallowShadowing.rule)
882882
config.DiscourageStringInterpolationWithStringFormat |> Option.bind (constructRuleIfEnabled DiscourageStringInterpolationWithStringFormat.rule)
883-
config.FavourBasicControlFlow |> Option.bind (constructRuleIfEnabled FavourBasicControlFlow.rule)
883+
config.RecommendIfElseConstructOverMatch |> Option.bind (constructRuleIfEnabled RecommendIfElseConstructOverMatch.rule)
884884
|]
885885

886886
findDeprecation config deprecatedAllRules allRules

src/FSharpLint.Core/FSharpLint.Core.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<Compile Include="Rules\Conventions\FavourNestedFunctions.fs" />
6464
<Compile Include="Rules\Conventions\DisallowShadowing.fs" />
6565
<Compile Include="Rules\Conventions\DiscourageStringInterpolationWithStringFormat.fs" />
66-
<Compile Include="Rules\Conventions\FavourBasicControlFlow.fs" />
66+
<Compile Include="Rules\Conventions\RecommendIfElseConstructOverMatch.fs" />
6767
<Compile Include="Rules\Conventions\SourceLength\SourceLengthHelper.fs" />
6868
<Compile Include="Rules\Conventions\SourceLength\MaxLinesInLambdaFunction.fs" />
6969
<Compile Include="Rules\Conventions\SourceLength\MaxLinesInMatchLambdaFunction.fs" />

src/FSharpLint.Core/Rules/Conventions/FavourBasicControlFlow.fs renamed to src/FSharpLint.Core/Rules/Conventions/RecommendIfElseConstructOverMatch.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module FSharpLint.Rules.FavourBasicControlFlow
1+
module FSharpLint.Rules.RecommendIfElseConstructOverMatch
22

33
open FSharpLint.Framework
44
open FSharpLint.Framework.Suggestion
@@ -26,14 +26,14 @@ let runner args =
2626
match args.AstNode with
2727
| AstNode.Expression(SynExpr.Match (_, _, synMatchClauses, range, _)) when isBasicControlFlow synMatchClauses ->
2828
{ Range = range
29-
Message = Resources.GetString "FavourBasicControlFlow"
29+
Message = Resources.GetString "RecommendIfElseConstructOverMatch"
3030
SuggestedFix = None
3131
TypeChecks = List.empty }
3232
|> Array.singleton
3333
| _ -> Array.empty
3434

3535
let rule =
36-
{ Name = "FavourBasicControlFlow"
37-
Identifier = Identifiers.FavourBasicControlFlow
36+
{ Name = "RecommendIfElseConstructOverMatch"
37+
Identifier = Identifiers.RecommendIfElseConstructOverMatch
3838
RuleConfig = { AstNodeRuleConfig.Runner = runner; Cleanup = ignore } }
3939
|> AstNodeRule

src/FSharpLint.Core/Rules/Identifiers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ let NoAsyncRunSynchronouslyInLibrary = identifier 90
9898
let FavourNestedFunctions = identifier 91
9999
let DisallowShadowing = identifier 92
100100
let DiscourageStringInterpolationWithStringFormat = identifier 93
101-
let FavourBasicControlFlow = identifier 94
101+
let RecommendIfElseConstructOverMatch = identifier 94

src/FSharpLint.Core/Text.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
<data name="RulesDiscourageStringInterpolationWithStringFormat" xml:space="preserve">
406406
<value>Use sprintf instead of String.Format.</value>
407407
</data>
408-
<data name="FavourBasicControlFlow" xml:space="preserve">
408+
<data name="RecommendIfElseConstructOverMatch" xml:space="preserve">
409409
<value>Rather use simpler if-else construct instead of match clause.</value>
410410
</data>
411411
</root>

src/FSharpLint.Core/fsharplint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
"avoidTooShortNames": { "enabled": false },
300300
"asyncExceptionWithoutReturn": { "enabled": false },
301301
"unneededRecKeyword": { "enabled": true },
302-
"favourBasicControlFlow": { "enabled": false },
302+
"recommendIfElseConstructOverMatch": { "enabled": false },
303303
"indentation": {
304304
"enabled": false
305305
},

tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<Compile Include="Rules\Conventions\FavourReRaise.fs" />
4444
<Compile Include="Rules\Conventions\DiscourageStringInterpolationWithStringFormat.fs" />
4545
<Compile Include="Rules\Conventions\FavourConsistentThis.fs" />
46-
<Compile Include="Rules\Conventions\FavourBasicControlFlow.fs" />
46+
<Compile Include="Rules\Conventions\RecommendIfElseConstructOverMatch.fs" />
4747
<Compile Include="Rules\Conventions\AvoidTooShortNames.fs" />
4848
<Compile Include="Rules\Conventions\AvoidSinglePipeOperator.fs" />
4949
<Compile Include="Rules\Conventions\SuggestUseAutoProperty.fs" />

tests/FSharpLint.Core.Tests/Rules/Conventions/FavourBasicControlFlow.fs renamed to tests/FSharpLint.Core.Tests/Rules/Conventions/RecommendIfElseConstructOverMatch.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
module FSharpLint.Core.Tests.Rules.Conventions.FavourBasicControlFlow
1+
module FSharpLint.Core.Tests.Rules.Conventions.RecommendIfElseConstructOverMatch
22

33
open NUnit.Framework
44
open FSharpLint.Rules
55
open FSharpLint.Core.Tests
66

77
[<TestFixture>]
8-
type TestConventionsFavourFavourBasicControlFlow() =
9-
inherit TestAstNodeRuleBase.TestAstNodeRuleBase(FavourBasicControlFlow.rule)
8+
type TestConventionsRecommendIfElseConstructOverMatch() =
9+
inherit TestAstNodeRuleBase.TestAstNodeRuleBase(RecommendIfElseConstructOverMatch.rule)
1010

1111

1212
[<Test>]

0 commit comments

Comments
 (0)