Skip to content

Commit 583ebc9

Browse files
Matt Mcveighwebwarrior-ws
andcommitted
Add regression test for deeper issue
Co-authored-by: webwarrior-ws <reg@webwarrior.ws>
1 parent 17fca43 commit 583ebc9

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/FSharpLint.Console.Tests/TestApp.fs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@ type TestConsoleApplication() =
118118

119119
Assert.AreEqual(int ExitCode.Failure, returnCode)
120120
Assert.AreEqual(set ["Use prefix syntax for generic type."], errors)
121+
122+
/// Regression for bug discovered during: https://github.com/fsprojects/FSharpLint/issues/466
123+
/// Adding a rule to the config was disabling other rules unless they're explicitly specified.
124+
[<Test>]
125+
member __.``Adding a rule to a custom config should not have side effects on other rules (from the default config).``() =
126+
let config = """
127+
{
128+
"exceptionNames": {
129+
"enabled": false
130+
}
131+
}
132+
"""
133+
use configFile = new TemporaryFile(config, "json")
134+
135+
let input = """
136+
type Signature =
137+
abstract member Encoded : string
138+
abstract member PathName : string
139+
"""
140+
141+
let (returnCode, errors) = main [| "lint"; "--lint-config"; configFile.FileName; input |]
142+
143+
Assert.AreEqual(-1, returnCode)
144+
Assert.AreEqual(set ["Consider changing `Signature` to be prefixed with `I`."], errors)
121145

122146
[<TestFixture>]
123147
type TestFileTypeInference() =

0 commit comments

Comments
 (0)