diff --git a/plugins/hls-stan-plugin/test/Main.hs b/plugins/hls-stan-plugin/test/Main.hs index 6c27e399d3a..473c5479f4a 100644 --- a/plugins/hls-stan-plugin/test/Main.hs +++ b/plugins/hls-stan-plugin/test/Main.hs @@ -33,6 +33,12 @@ tests = assertBool "" $ T.isPrefixOf expectedPrefix (reduceDiag ^. L.message) reduceDiag ^. L.source @?= Just "stan" return () + , testCase "ignores diagnostics from .stan.toml" $ + runStanSession "" $ do + doc <- openDoc "dir/configTest.hs" "haskell" + diags <- waitForDiagnosticsFromSource doc "stan" + liftIO $ length diags @?= 0 + return () ] testDir :: FilePath diff --git a/plugins/hls-stan-plugin/test/testdata/.stan.toml b/plugins/hls-stan-plugin/test/testdata/.stan.toml new file mode 100644 index 00000000000..ecb49637962 --- /dev/null +++ b/plugins/hls-stan-plugin/test/testdata/.stan.toml @@ -0,0 +1,14 @@ +[[check]] +type = "Exclude" +id = "STAN-0206" +scope = "all" + +[[check]] +type = "Exclude" +id = "STAN-0103" +file = "dir/configTest.hs" + +[[check]] +type = "Exclude" +id = "STAN-0212" +directory = "dir/" diff --git a/plugins/hls-stan-plugin/test/testdata/dir/configTest.hs b/plugins/hls-stan-plugin/test/testdata/dir/configTest.hs new file mode 100644 index 00000000000..b2ed26a7454 --- /dev/null +++ b/plugins/hls-stan-plugin/test/testdata/dir/configTest.hs @@ -0,0 +1,5 @@ +data A = A Int Int + +a = length [1..] + +b = undefined