From a37803d2b873329f062788f5bcfd20fca8f45edc Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Mon, 18 Dec 2023 23:57:47 -0500 Subject: [PATCH] Remove partial head function from src/ShellCheck/Formatter/CheckStyle.hs --- src/ShellCheck/Formatter/CheckStyle.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ShellCheck/Formatter/CheckStyle.hs b/src/ShellCheck/Formatter/CheckStyle.hs index 6ad6c9c8d..3f898c368 100644 --- a/src/ShellCheck/Formatter/CheckStyle.hs +++ b/src/ShellCheck/Formatter/CheckStyle.hs @@ -24,8 +24,8 @@ import ShellCheck.Formatter.Format import Data.Char import Data.List -import GHC.Exts import System.IO +import qualified Data.List.NonEmpty as NE format :: IO Formatter format = return Formatter { @@ -45,12 +45,12 @@ outputResults cr sys = else mapM_ outputGroup fileGroups where comments = crComments cr - fileGroups = groupWith sourceFile comments + fileGroups = NE.groupWith sourceFile comments outputGroup group = do - let filename = sourceFile (head group) + let filename = sourceFile (NE.head group) result <- siReadFile sys (Just True) filename let contents = either (const "") id result - outputFile filename contents group + outputFile filename contents (NE.toList group) outputFile filename contents warnings = do let comments = makeNonVirtual warnings contents