summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-12 11:32:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-12 11:32:06 -0400
commit942d8f72984377c4e69d7c55877621d434e5d687 (patch)
treeda1f205c66d57a4a88c727af382c4d6e09c2e881 /Command
parent85f0992c0378aad442da5dbbd5deadffe33f77e1 (diff)
hlint
Diffstat (limited to 'Command')
-rw-r--r--Command/Commit.hs2
-rw-r--r--Command/Fsck.hs6
-rw-r--r--Command/Get.hs2
-rw-r--r--Command/Move.hs4
-rw-r--r--Command/Uninit.hs4
-rw-r--r--Command/Watch.hs6
-rw-r--r--Command/Whereis.hs2
7 files changed, 13 insertions, 13 deletions
diff --git a/Command/Commit.hs b/Command/Commit.hs
index 1c82ed7df..f53ab7e09 100644
--- a/Command/Commit.hs
+++ b/Command/Commit.hs
@@ -22,7 +22,7 @@ seek = [withNothing start]
start :: CommandStart
start = next $ next $ do
Annex.Branch.commit "update"
- _ <- runhook =<< (inRepo $ Git.hookPath "annex-content")
+ _ <- runhook =<< inRepo (Git.hookPath "annex-content")
return True
where
runhook (Just hook) = liftIO $ boolSystem hook []
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 1fc656207..7bfc46f4a 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -145,13 +145,13 @@ fixLink key file = do
-}
whenM (liftIO $ doesFileExist file) $
unlessM (inAnnex key) $ do
- showNote $ "fixing content location"
+ showNote "fixing content location"
dir <- liftIO $ parentDir <$> absPath file
let content = absPathFrom dir have
liftIO $ allowWrite (parentDir content)
moveAnnex key content
- showNote $ "fixing link"
+ showNote "fixing link"
liftIO $ createDirectoryIfMissing True (parentDir file)
liftIO $ removeFile file
liftIO $ createSymbolicLink want file
@@ -220,7 +220,7 @@ checkKeySize' key file bad = case Types.Key.keySize key of
Nothing -> return True
Just size -> do
size' <- fromIntegral . fileSize
- <$> (liftIO $ getFileStatus file)
+ <$> liftIO (getFileStatus file)
comparesizes size size'
where
comparesizes a b = do
diff --git a/Command/Get.hs b/Command/Get.hs
index 772fbd90c..c4ba48312 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -26,7 +26,7 @@ start from file (key, _) = stopUnless (not <$> inAnnex key) $
autoCopies file key (<) $ \_numcopies ->
case from of
Nothing -> go $ perform key
- Just src -> do
+ Just src ->
-- get --from = copy --from
stopUnless (Command.Move.fromOk src key) $
go $ Command.Move.fromPerform src False key
diff --git a/Command/Move.hs b/Command/Move.hs
index 8612c9f2d..6ec7cd90a 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -128,9 +128,9 @@ fromOk src key
expensive = do
u <- getUUID
remotes <- Remote.keyPossibilities key
- return $ u /= Remote.uuid src && any (== src) remotes
+ return $ u /= Remote.uuid src && elem src remotes
fromPerform :: Remote -> Bool -> Key -> CommandPerform
-fromPerform src move key = moveLock move key $ do
+fromPerform src move key = moveLock move key $
ifM (inAnnex key)
( handle move True
, do
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index 5724bffd0..46a2480e6 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -28,8 +28,8 @@ check = do
"cannot uninit when the " ++ show b ++ " branch is checked out"
top <- fromRepo Git.repoPath
cwd <- liftIO getCurrentDirectory
- whenM ((/=) <$> liftIO (absPath top) <*> liftIO (absPath cwd)) $ error $
- "can only run uninit from the top of the git repository"
+ whenM ((/=) <$> liftIO (absPath top) <*> liftIO (absPath cwd)) $
+ error "can only run uninit from the top of the git repository"
where
current_branch = Git.Ref . Prelude.head . lines <$> revhead
revhead = inRepo $ Git.Command.pipeRead
diff --git a/Command/Watch.hs b/Command/Watch.hs
index e049591e9..0ee932dba 100644
--- a/Command/Watch.hs
+++ b/Command/Watch.hs
@@ -176,7 +176,7 @@ runHandler :: MVar Annex.AnnexState -> ChangeChan -> Handler -> FilePath -> IO (
runHandler st changechan handler file = void $ do
r <- tryIO (runStateMVar st $ handler file)
case r of
- Left e -> putStrLn $ show e
+ Left e -> print e
Right Nothing -> noop
Right (Just change) -> void $
runChangeChan $ writeTChan changechan change
@@ -236,7 +236,7 @@ onAddSymlink file = go =<< Backend.lookupFile file
- So for speed, tries to reuse the existing blob for
- the symlink target. -}
addlink link = do
- v <- catObjectDetails $ Ref $ ":" ++ file
+ v <- catObjectDetails $ Ref $ ':':file
case v of
Just (currlink, sha)
| s2w8 link == L.unpack currlink ->
@@ -307,7 +307,7 @@ commitThread st changechan = forever $ do
-- Now see if now's a good time to commit.
time <- getCurrentTime
if shouldCommit time cs
- then void $ tryIO $ runStateMVar st $ commitStaged
+ then void $ tryIO $ runStateMVar st commitStaged
else refillChanges changechan cs
where
oneSecond = 1000000 -- microseconds
diff --git a/Command/Whereis.hs b/Command/Whereis.hs
index eb6ea7c56..b697bf554 100644
--- a/Command/Whereis.hs
+++ b/Command/Whereis.hs
@@ -37,7 +37,7 @@ perform remotemap key = do
unless (null safelocations) $ showLongNote pp
pp' <- prettyPrintUUIDs "untrusted" untrustedlocations
unless (null untrustedlocations) $ showLongNote $ untrustedheader ++ pp'
- forM_ (catMaybes $ map (`M.lookup` remotemap) locations) $
+ forM_ (mapMaybe (`M.lookup` remotemap) locations) $
performRemote key
if null safelocations then stop else next $ return True
where