Skip to content

Commit

Permalink
Remove partial head function from src/ShellCheck/Formatter/CheckStyle.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Dec 19, 2023
1 parent 5a96137 commit a37803d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ShellCheck/Formatter/CheckStyle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit a37803d

Please sign in to comment.