Skip to content

Commit

Permalink
Remove partial head function from src/ShellCheck/Formatter/GCC.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Dec 11, 2023
1 parent e5208cc commit 5a96137
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ShellCheck/Formatter/GCC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import ShellCheck.Interface
import ShellCheck.Formatter.Format

import Data.List
import GHC.Exts
import System.IO
import qualified Data.List.NonEmpty as NE

format :: IO Formatter
format = return Formatter {
Expand All @@ -39,13 +39,13 @@ outputError file error = hPutStrLn stderr $ file ++ ": " ++ error
outputAll 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
outputResult filename contents group
outputResult filename contents (NE.toList group)

outputResult filename contents warnings = do
let comments = makeNonVirtual warnings contents
Expand Down

0 comments on commit 5a96137

Please sign in to comment.