Skip to content

Add hlint config and github action#157

Merged
alt-romes merged 1 commit into
well-typed:masterfrom
cabalism:add/hlint-config
Jan 8, 2026
Merged

Add hlint config and github action#157
alt-romes merged 1 commit into
well-typed:masterfrom
cabalism:add/hlint-config

Conversation

@philderbeast
Copy link
Copy Markdown
Contributor

What an awesome addition to the Haskell toolset.

I tried configuring the project for linting and found remarkably few suggestions, all currently ignored. I exclude one module that doesn't parse.

Are you up for enabling -XMultilineStrings? If so I can get HLint to parse that module with this change:

$ git diff
diff --git a/.hlint.yaml b/.hlint.yaml
index 8b68b50..52eea92 100644
--- a/.hlint.yaml
+++ b/.hlint.yaml
@@ -26,5 +26,3 @@
 - ignore: {name: "Use record patterns"} # 1 hint
 - ignore: {name: "Use uncurry"} # 2 hints
 - ignore: {name: "Use unless"} # 2 hints
-- arguments:
-    - --ignore-glob=haskell-debugger/GHC/Debugger/Runtime/Thread/Stack.hs
diff --git a/haskell-debugger/GHC/Debugger/Runtime/Thread/Stack.hs b/haskell-debugger/GHC/Debugger/Runtime/Thread/Stack.hs
index 3eeca85..23441df 100644
--- a/haskell-debugger/GHC/Debugger/Runtime/Thread/Stack.hs
+++ b/haskell-debugger/GHC/Debugger/Runtime/Thread/Stack.hs
@@ -4,6 +4,7 @@
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE LambdaCase #-}
 {-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE MultilineStrings #-}
 
 -- | Decoding the stack of a thread at runtime
 module GHC.Debugger.Runtime.Thread.Stack
@@ -181,10 +182,10 @@ bcoBreakPointInfoParser = do
           | otherwise = 0 :: Int
 
     let find_ixs_fv = Remote.raw $
-          "\\x -> let index_at n = GHC.Word.W16# (GHC.Base.indexWord16Array# x (n GHC.Exts.+# " ++ show bRK_FUN_offset ++ "#)) " ++
-                   "in if (index_at 0# Data.Bits..&. 0xFF) == 66{-bci_BRK_FUN-} then \
-                        Just (index_at 1#, index_at 2#, index_at 3#, index_at 4#, index_at 5#) \
-                      else Nothing"
+          "\\x -> let index_at n = GHC.Word.W16# (GHC.Base.indexWord16Array# x (n GHC.Exts.+# " ++ show bRK_FUN_offset ++ """#))
+                    in if (index_at 0# Data.Bits..&. 0xFF) == 66{-bci_BRK_FUN-} then
+                        Just (index_at 1#, index_at 2#, index_at 3#, index_at 4#, index_at 5#)
+                      else Nothing"""
     rs_fv <- expectRight =<< Remote.eval
       (find_ixs_fv `Remote.app` Remote.untypedRef instrs_array_fv)

@alt-romes
Copy link
Copy Markdown
Collaborator

Hi @philderbeast, welcome! Thanks for taking an interest in the project.

I should say that I'm not particularly inclined to enforce linting on the project.

However, I would be happy to keep the .hlint.yaml file if you think that would make it easier for contributors. I can imagine they would see less unnecessary warnings in their code if it is properly configured, and potentially make it easier to write better code.

Review:

  • Using MultiLineStrings sounds good, so we can drop the ad-hoc hlint filter
  • As per above, could you drop the CI configuration for linting?

@philderbeast philderbeast force-pushed the add/hlint-config branch 2 times, most recently from 003aeb9 to fe2ed32 Compare January 8, 2026 17:52
@philderbeast
Copy link
Copy Markdown
Contributor Author

I've dropped the github workflow and added -XMultilineStrings in one module.

@alt-romes
Copy link
Copy Markdown
Collaborator

alt-romes commented Jan 8, 2026

Thanks!

The commit message says

- Ignore Stack.hs with parse error

Could you remove that outdated part? Perhaps say: Add multi-line strings to make hlint capable of parsing that module.

@philderbeast
Copy link
Copy Markdown
Contributor Author

I like to leave commit history messages to show how I got to the squashed commit but can rewrite the message to only refer to what can now be seen in the commit.

- Use -XMultilineString in Thread/Stack
@alt-romes
Copy link
Copy Markdown
Collaborator

Thanks for updating it! Indeed, in this project we'd rather follow the style where a commit message refers only to what the commit is in the end. Alternative styles are also reasonable, but this is the one we're taking for haskell-debugger.

Thanks again! I'll land it once CI passes.

@philderbeast
Copy link
Copy Markdown
Contributor Author

I'm not able to reproduce the "Build and Run Integration Tests (9.14.1)" failure locally, either when setting "DEBUGGER=... make test" in the environment or by doing a cabal install haskell-debugger --overwrite-policy=always before running the test.

@alt-romes alt-romes merged commit 89652c9 into well-typed:master Jan 8, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants