From dc20fea7ddd1d86a75f72e501cac75dd9c391779 Mon Sep 17 00:00:00 2001 From: Lei Zhu Date: Tue, 27 Jun 2023 21:49:28 +0800 Subject: [PATCH 1/2] Ship hls-hlint-plugin for ghc-9.6 --- .github/workflows/test.yml | 6 +++--- cabal.project | 2 +- docs/support/plugin-support.md | 2 +- haskell-language-server.cabal | 4 ++-- plugins/hls-hlint-plugin/hls-hlint-plugin.cabal | 6 +----- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ddfca48333..4f9e3b6d99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -162,11 +162,11 @@ jobs: name: Test hls-splice-plugin run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || cabal test hls-splice-plugin --test-options="$TEST_OPTS" - - if: matrix.test + - if: matrix.test name: Test hls-stylish-haskell-plugin run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" - - if: matrix.test + - if: matrix.test name: Test hls-ormolu-plugin run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" @@ -194,7 +194,7 @@ jobs: name: Test hls-rename-plugin test suite run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || cabal test hls-rename-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.6' + - if: matrix.test name: Test hls-hlint-plugin test suite run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin --test-options="$TEST_OPTS" diff --git a/cabal.project b/cabal.project index 476e65bcfd..2dc12eb573 100644 --- a/cabal.project +++ b/cabal.project @@ -56,7 +56,7 @@ package * write-ghc-environment-files: never -index-state: 2023-06-25T00:00:00Z +index-state: 2023-06-27T10:50:26Z constraints: -- For GHC 9.4, older versions of entropy fail to build on Windows diff --git a/docs/support/plugin-support.md b/docs/support/plugin-support.md index b7c8584076..475e5703ba 100644 --- a/docs/support/plugin-support.md +++ b/docs/support/plugin-support.md @@ -55,7 +55,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has | `hls-floskell-plugin` | 2 | 9.6 | | `hls-fourmolu-plugin` | 2 | | | `hls-gadt-plugin` | 2 | | -| `hls-hlint-plugin` | 2 | 9.6 | +| `hls-hlint-plugin` | 2 | | | `hls-module-name-plugin` | 2 | | | `hls-qualify-imported-names-plugin` | 2 | | | `hls-ormolu-plugin` | 2 | | diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 19551a9723..3afbe687fd 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -272,7 +272,7 @@ common tactic cpp-options: -Dhls_tactic common hlint - if flag(hlint) && impl(ghc < 9.5) + if flag(hlint) build-depends: hls-hlint-plugin == 2.1.0.0 cpp-options: -Dhls_hlint @@ -354,7 +354,7 @@ common ormolu cpp-options: -Dhls_ormolu common stylishHaskell - if flag(stylishHaskell) + if flag(stylishHaskell) build-depends: hls-stylish-haskell-plugin == 2.1.0.0 cpp-options: -Dhls_stylishHaskell diff --git a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal index e149a4256a..a9cd8b80ef 100644 --- a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal +++ b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal @@ -30,8 +30,6 @@ flag pedantic manual: True library - if impl(ghc >= 9.5) - buildable: False exposed-modules: Ide.Plugin.Hlint hs-source-dirs: src build-depends: @@ -49,7 +47,7 @@ library , ghc-exactprint >=0.6.3.4 , ghcide == 2.1.0.0 , hashable - , hlint < 3.6 + , hlint < 3.7 , hls-plugin-api == 2.1.0.0 , lens , lsp @@ -78,8 +76,6 @@ library TypeOperators test-suite tests - if impl(ghc >= 9.5) - buildable: False type: exitcode-stdio-1.0 default-language: Haskell2010 hs-source-dirs: test From 7d321638124badcddb2119a662bd2695ab4427d1 Mon Sep 17 00:00:00 2001 From: Lei Zhu Date: Wed, 28 Jun 2023 19:00:55 +0800 Subject: [PATCH 2/2] Add tag for specific tests --- plugins/hls-hlint-plugin/test/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hls-hlint-plugin/test/Main.hs b/plugins/hls-hlint-plugin/test/Main.hs index a0790c89bf..fab38e4d7d 100644 --- a/plugins/hls-hlint-plugin/test/Main.hs +++ b/plugins/hls-hlint-plugin/test/Main.hs @@ -185,11 +185,11 @@ suggestionsTests = doc <- openDoc "IgnoreAnnHlint.hs" "haskell" expectNoMoreDiagnostics 3 doc "hlint" - , knownBrokenForGhcVersions [GHC92, GHC94] "apply-refact has different behavior on v0.10" $ + , knownBrokenForGhcVersions [GHC92, GHC94, GHC96] "apply-refact has different behavior on v0.10" $ testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do testRefactor "Comments.hs" "Redundant bracket" expectedComments - , onlyRunForGhcVersions [GHC92, GHC94] "only run test for apply-refact-0.10" $ + , onlyRunForGhcVersions [GHC92, GHC94, GHC96] "only run test for apply-refact-0.10" $ testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do testRefactor "Comments.hs" "Redundant bracket" expectedComments'