Skip to content

Commit

Permalink
Remove partial head function from src/ShellCheck/Formatter/JSON1.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Dec 11, 2023
1 parent 4c1d917 commit e5208cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ShellCheck/Formatter/JSON1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import Control.DeepSeq
import Data.Aeson
import Data.IORef
import Data.Monoid
import GHC.Exts
import System.IO
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.List.NonEmpty as NE

format :: IO Formatter
format = do
Expand Down Expand Up @@ -114,10 +114,10 @@ outputError file msg = hPutStrLn stderr $ file ++ ": " ++ msg
collectResult ref cr sys = mapM_ f groups
where
comments = crComments cr
groups = groupWith sourceFile comments
f :: [PositionedComment] -> IO ()
groups = NE.groupWith sourceFile comments
f :: NE.NonEmpty PositionedComment -> IO ()
f 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
let comments' = makeNonVirtual comments contents
Expand Down

0 comments on commit e5208cc

Please sign in to comment.