Correctly discard overlapping fixes in diff output (fixes )

This commit is contained in:
Vidar Holen 2022-07-26 09:46:07 -07:00
parent e9784fa9a7
commit c57e447c89
1 changed files with 1 additions and 2 deletions
src/ShellCheck/Formatter

View File

@ -203,10 +203,9 @@ formatDoc color (DiffDoc name lf regions) =
buildFixMap :: [Fix] -> M.Map String Fix
buildFixMap fixes = perFile
where
splitFixes = concatMap splitFixByFile fixes
splitFixes = splitFixByFile $ mconcat fixes
perFile = groupByMap (posFile . repStartPos . head . fixReplacements) splitFixes
-- There are currently no multi-file fixes, but let's handle it anyways
splitFixByFile :: Fix -> [Fix]
splitFixByFile fix = map makeFix $ groupBy sameFile (fixReplacements fix)
where