From 2780ba9a366b3337d838f64ab74fe13eb8d51992 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Mon, 15 Apr 2024 23:24:17 +0900 Subject: [PATCH] Do not insert an empty line after a standalone kind signature --- CHANGELOG.md | 2 ++ TESTS.md | 2 ++ src/HIndent/Ast/Declaration.hs | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 454e54b07..774cea6e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Changed - The formatting style of import declarations with constructors ([#829]). +- HIndent no longer inserts an empty line after a standalone kind signature ([#873]). ### Fixed @@ -375,6 +376,7 @@ This version is accidentally pushlished, and is the same as 5.3.3. [@uhbif19]: https://github.com/uhbif19 [@toku-sa-n]: https://github.com/toku-sa-n +[#873]: https://github.com/mihaimaruseac/hindent/pull/873 [#868]: https://github.com/mihaimaruseac/hindent/pull/868 [#849]: https://github.com/mihaimaruseac/hindent/pull/849 [#843]: https://github.com/mihaimaruseac/hindent/pull/843 diff --git a/TESTS.md b/TESTS.md index 22a5f7759..50cf47af1 100644 --- a/TESTS.md +++ b/TESTS.md @@ -409,6 +409,8 @@ data family Foo a {-# LANGUAGE StandaloneKindSignatures #-} type Foo :: Type -> Type -> Type +data Foo a b = + Foo a b ``` Default declaration diff --git a/src/HIndent/Ast/Declaration.hs b/src/HIndent/Ast/Declaration.hs index 6db05a53c..2fe560a20 100644 --- a/src/HIndent/Ast/Declaration.hs +++ b/src/HIndent/Ast/Declaration.hs @@ -122,4 +122,5 @@ mkDeclaration GHC.DocD {} = isSignature :: Declaration -> Bool isSignature Signature {} = True +isSignature StandaloneKindSignature {} = True isSignature _ = False