From 29422b6a3dd9b4ea2de12cad7622d19835e34b00 Mon Sep 17 00:00:00 2001 From: Jonathan Conder Date: Fri, 30 Jan 2026 16:07:24 +1300 Subject: [PATCH] Fix JSON1 repeated comments across multiple files Previously shellcheck would list all comments for each file. Now it only lists the comments which pertain to the file in question. --- src/ShellCheck/Formatter/JSON1.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ShellCheck/Formatter/JSON1.hs b/src/ShellCheck/Formatter/JSON1.hs index b4dbe352d..d523bdb65 100644 --- a/src/ShellCheck/Formatter/JSON1.hs +++ b/src/ShellCheck/Formatter/JSON1.hs @@ -120,7 +120,7 @@ collectResult ref cr sys = mapM_ f groups let filename = sourceFile (NE.head group) result <- siReadFile sys (Just True) filename let contents = either (const "") id result - let comments' = makeNonVirtual comments contents + let comments' = makeNonVirtual (NE.toList group) contents deepseq comments' $ modifyIORef ref (\x -> comments' ++ x) finish ref = do