Skip to content

Commit ce43cb2

Browse files
committed
Console: fix FSharpLint warning on self-check
Use regular string instead of interpolated string because there are no embedded expressions in that string. Use `failwith` instead of `failwithf` where there is no string substitution.
1 parent 5ff1ba2 commit ce43cb2

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/FSharpLint.Console/Program.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ let private start (arguments:ParseResults<ToolArgs>) (toolsPath:Ionide.ProjInfo.
169169
| FileType.Source -> Lint.lintSource lintParams target
170170
| FileType.Solution -> Lint.lintSolution lintParams target toolsPath
171171
| FileType.Wildcard ->
172-
output.WriteInfo $"Wildcard detected, but not recommended. Using a project (slnx/sln/fsproj) can detect more issues."
172+
output.WriteInfo "Wildcard detected, but not recommended. Using a project (slnx/sln/fsproj) can detect more issues."
173173
let files = expandWildcard target
174174
if List.isEmpty files then
175175
output.WriteInfo $"No files matching pattern '%s{target}' were found."

tests/FSharpLint.Core.Tests/Rules/TestAstNodeRule.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type TestAstNodeRuleBase (rule:Rule) =
2424
let rule =
2525
match rule with
2626
| AstNodeRule rule -> rule
27-
| _ -> failwithf "TestAstNodeRuleBase only accepts AstNodeRules"
27+
| _ -> failwith "TestAstNodeRuleBase only accepts AstNodeRules"
2828

2929
let globalConfig = Option.defaultValue GlobalRuleConfig.Default globalConfig
3030

@@ -53,4 +53,4 @@ type TestAstNodeRuleBase (rule:Rule) =
5353

5454
Array.iter this.PostSuggestion suggestions
5555
| _ ->
56-
failwithf "Failed to parse"
56+
failwith "Failed to parse"

tests/FSharpLint.Core.Tests/Rules/TestHintMatcherBase.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type TestHintMatcherBase () =
4747
let rule =
4848
match HintMatcher.rule { HintTrie = hintTrie } with
4949
| Rules.AstNodeRule rule -> rule
50-
| _ -> failwithf "TestHintMatcherBase only accepts AstNodeRules"
50+
| _ -> failwith "TestHintMatcherBase only accepts AstNodeRules"
5151

5252
let globalConfig = Option.defaultValue GlobalRuleConfig.Default globalConfig
5353

@@ -72,4 +72,4 @@ type TestHintMatcherBase () =
7272
|> fst
7373
Array.iter this.PostSuggestion suggestions
7474
| _ ->
75-
failwithf "Failed to parse"
75+
failwith "Failed to parse"

tests/FSharpLint.Core.Tests/Rules/TestIndentationRule.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type TestIndentationRuleBase (rule:Rule) =
2424
let rule =
2525
match rule with
2626
| IndentationRule rule -> rule
27-
| _ -> failwithf "TestIndentationRuleBase only accepts IndentationRules"
27+
| _ -> failwith "TestIndentationRuleBase only accepts IndentationRules"
2828

2929
let globalConfig = Option.defaultValue GlobalRuleConfig.Default globalConfig
3030

tests/FSharpLint.Core.Tests/Rules/TestLineRule.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type TestLineRuleBase (rule:Rule) =
2626
let rule =
2727
match rule with
2828
| LineRule rule -> rule
29-
| _ -> failwithf "TestLineRuleBase only accepts LineRules"
29+
| _ -> failwith "TestLineRuleBase only accepts LineRules"
3030

3131
let lines = input.Split "\n"
3232

tests/FSharpLint.Core.Tests/Rules/TestNoTabCharactersRule.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type TestNoTabCharactersRuleBase (rule:Rule) =
2424
let rule =
2525
match rule with
2626
| NoTabCharactersRule rule -> rule
27-
| _ -> failwithf "TestNoTabCharactersRuleBase only accepts NoTabCharactersRules"
27+
| _ -> failwith "TestNoTabCharactersRuleBase only accepts NoTabCharactersRules"
2828

2929
let globalConfig = Option.defaultValue GlobalRuleConfig.Default globalConfig
3030

0 commit comments

Comments
 (0)