Skip to content

Commit

Permalink
hlint tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
juhp committed Aug 17, 2024
1 parent 2dee8d7 commit ac3d443
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Cmd/Bump.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bumpPkg dryrun local mcmsg mclog pkg br = do
autorelease <- isAutoRelease spec
if autorelease
then
if length unpushed > 0
if not (null unpushed)
then putStrLn $ "autorelease: unpushed" +-+
case length unpushed of
1 -> "commit"
Expand Down
10 changes: 5 additions & 5 deletions src/Cmd/Copr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ existingChrootBuilds user project actualpkg verrel chroots = do
let pkgmonitor = fromMaybe [] $ lookup actualpkg monitorPkgs
let buildingChroots =
filterTasks verrel (`elem` coprProcessingStates) pkgmonitor
if (null buildingChroots)
if null buildingChroots
then return $ filterTasks verrel (`notElem` ["failed","skipped"]) pkgmonitor
else do
mapM_ printCoprTask buildingChroots
Expand All @@ -252,8 +252,8 @@ existingChrootBuilds user project actualpkg verrel chroots = do
return buildingChroots

filterTasks :: String -> (String -> Bool) -> [CoprTask] -> [CoprTask]
filterTasks verrel statustest tasks =
filter (\CoprTask{..} -> taskVerRel == verrel && statustest taskStatus) tasks
filterTasks verrel statustest =
filter (\CoprTask{..} -> taskVerRel == verrel && statustest taskStatus)

coprBuild :: Bool -> String -> String -> FilePath -> FilePath -> [Chroot] -> IO ()
coprBuild _ _ _ _ _ [] = error' "No chroots chosen"
Expand Down Expand Up @@ -333,8 +333,8 @@ coprMonitorPackages :: String -> String -> IO [CoprPackage]
coprMonitorPackages user proj = do
builds <- coprGetBuildList fedoraCopr user proj []
mapM_ coprWaitPackage (lookupKey' "items" builds :: [Object])
coprMonitorProject fedoraCopr user proj [] >>=
return . mapMaybe pkgResults . lookupKey' "packages"
mapMaybe pkgResults . lookupKey' "packages" <$>
coprMonitorProject fedoraCopr user proj []
where
pkgResults :: Object -> Maybe CoprPackage
pkgResults obj = do
Expand Down
2 changes: 1 addition & 1 deletion src/Cmd/Diff.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ diffCmd debug speconly work fmt ignorebumps patts mwbr =

filterPattern :: DiffFilter -> String -> Bool
filterPattern (DiffMatch patt) = (patt `isInfixOf`)
filterPattern (DiffNotMatch patt) = (not . (patt `isInfixOf`))
filterPattern (DiffNotMatch patt) = not . (patt `isInfixOf`)
2 changes: 1 addition & 1 deletion src/Cmd/ReviewPackage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ reviewPackageInteractive bid pkg session bug = do
cmd_ "ls" ["-F"]
putNewLn
-- FIXME default to no if nvr unchanged?
yesNoDefault True $ "Press Enter to install/prep srpm"
yesNoDefault True "Press Enter to install/prep srpm"
else return True
let spec = pkg <.> "spec"
when importsrpm $ do
Expand Down
2 changes: 1 addition & 1 deletion src/Git.hs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ gitPush quiet mref = do
if ok
then putStrLn $ if quiet then "done" else last (lines err)
else do
when quiet $ putNewLn
when quiet putNewLn
putStrLn $ unwords ("git" : args) +-+ "failed with\n" ++ err
yes <- yesNo "Retry git push"
-- FIXME going to fail if ref no longer on branch
Expand Down
2 changes: 1 addition & 1 deletion src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ main = do
dryrunOpt desc = switchWith 'n' "dry-run" desc <|>
switchLongWith "dryrun" "alias for --dry-run"

debugOpt desc = switchWith 'd' "debug" desc
debugOpt = switchWith 'd' "debug"

skipFetchOpt = switchWith 'S' "skip-fetch" "Do not git fetch"

Expand Down
3 changes: 1 addition & 2 deletions src/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ isAutoRelease spec = do
return $ not (null matches)

isAutoChangelog :: FilePath -> IO Bool
isAutoChangelog spec =
grep_ "^%autochangelog" spec
isAutoChangelog = grep_ "^%autochangelog"

pkgNameVerRel :: Branch -> FilePath -> IO (Maybe NVR)
pkgNameVerRel = pkgNameVerRelDist . Just
Expand Down

0 comments on commit ac3d443

Please sign in to comment.