mirror of
https://github.com/github/semantic.git
synced 2025-01-02 20:41:38 +03:00
Apply some of hlint’s advice.
This commit is contained in:
parent
488ec69895
commit
b47bc5bc16
@ -100,7 +100,7 @@ spec = parallel $ do
|
||||
describe "splitPatchByLines" $ do
|
||||
prop "starts at initial indices" $
|
||||
\ patch sources -> let indices = length <$> sources in
|
||||
fmap start . maybeFirst . Maybe.catMaybes <$> Both.unzip (fmap maybeFirst . unRow . fmap Prelude.snd <$> (splitPatchByLines ((Source.++) <$> sources <*> sources) (patchWithBoth patch (leafWithRangeInSource <$> sources <*> (Range <$> indices <*> ((2 *) <$> indices)))))) `shouldBe` (<$) <$> indices <*> unPatch patch
|
||||
fmap start . maybeFirst . Maybe.catMaybes <$> Both.unzip (fmap maybeFirst . unRow . fmap Prelude.snd <$> splitPatchByLines ((Source.++) <$> sources <*> sources) (patchWithBoth patch (leafWithRangeInSource <$> sources <*> (Range <$> indices <*> ((2 *) <$> indices))))) `shouldBe` (<$) <$> indices <*> unPatch patch
|
||||
|
||||
describe "openLineBy" $ do
|
||||
it "produces the earliest non-empty line in a list, if open" $
|
||||
@ -123,11 +123,11 @@ spec = parallel $ do
|
||||
|
||||
getTotalRange (Source vector) = Range 0 $ length vector
|
||||
|
||||
combineIntoLeaves (leaves, start) char = (leaves ++ [ Free $ Annotated (Info <$> (pure (Range start $ start + 1)) <*> mempty) (Leaf [ char ]) ], start + 1)
|
||||
combineIntoLeaves (leaves, start) char = (leaves ++ [ Free $ Annotated (Info <$> pure (Range start $ start + 1) <*> mempty) (Leaf [ char ]) ], start + 1)
|
||||
|
||||
leafWithRangesInSources sources ranges = Free $ Annotated (Info <$> ranges <*> pure mempty) (Leaf $ runBothWith (++) (toList <$> sources))
|
||||
|
||||
leafWithRangeInSource source range = (Info range mempty :< Leaf source)
|
||||
leafWithRangeInSource source range = Info range mempty :< Leaf source
|
||||
|
||||
patchWithBoth (Insert ()) = Insert . snd
|
||||
patchWithBoth (Delete ()) = Delete . fst
|
||||
|
Loading…
Reference in New Issue
Block a user