"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/ShellCheck/Formatter/Diff.hs" between
shellcheck-0.8.0.tar.gz and shellcheck-0.9.0.tar.gz

About: ShellCheck is a static analysis and linting tool for sh/bash scripts (written in Haskell).

Diff.hs  (shellcheck-0.8.0):Diff.hs  (shellcheck-0.9.0)
skipping to change at line 205 skipping to change at line 205
in in
(color bold $ "--- " ++ ("a" </> name)) ++ "\n" ++ (color bold $ "--- " ++ ("a" </> name)) ++ "\n" ++
(color bold $ "+++ " ++ ("b" </> name)) ++ "\n" ++ (color bold $ "+++ " ++ ("b" </> name)) ++ "\n" ++
concatMap (formatRegion color LinefeedOk) most ++ concatMap (formatRegion color LinefeedOk) most ++
concatMap (formatRegion color lf) last concatMap (formatRegion color lf) last
-- Create a Map from filename to Fix -- Create a Map from filename to Fix
buildFixMap :: [Fix] -> M.Map String Fix buildFixMap :: [Fix] -> M.Map String Fix
buildFixMap fixes = perFile buildFixMap fixes = perFile
where where
splitFixes = concatMap splitFixByFile fixes splitFixes = splitFixByFile $ mconcat fixes
perFile = groupByMap (posFile . repStartPos . head . fixReplacements) splitF ixes perFile = groupByMap (posFile . repStartPos . head . fixReplacements) splitF ixes
splitFixByFile :: Fix -> [Fix] splitFixByFile :: Fix -> [Fix]
splitFixByFile fix = map makeFix $ groupBy sameFile (fixReplacements fix) splitFixByFile fix = map makeFix $ groupBy sameFile (fixReplacements fix)
where where
sameFile rep1 rep2 = (posFile $ repStartPos rep1) == (posFile $ repStartPos rep2) sameFile rep1 rep2 = (posFile $ repStartPos rep1) == (posFile $ repStartPos rep2)
makeFix reps = newFix { fixReplacements = reps } makeFix reps = newFix { fixReplacements = reps }
groupByMap :: (Ord k, Monoid v) => (v -> k) -> [v] -> M.Map k v groupByMap :: (Ord k, Monoid v) => (v -> k) -> [v] -> M.Map k v
groupByMap f = M.fromListWith Monoid.mappend . map (\x -> (f x, x)) groupByMap f = M.fromListWith Monoid.mappend . map (\x -> (f x, x))
-- For building unit tests -- For building unit tests
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)