mirror of
https://github.com/ryantm/nixpkgs-update.git
synced 2024-12-14 21:33:46 +03:00
fix warnings and doctests
This commit is contained in:
parent
4f8fd114fc
commit
59172c23f3
13
src/Check.hs
13
src/Check.hs
@ -19,11 +19,12 @@ import Utils (UpdateEnv(..), Version, nixBuildOptions, runtimeDir)
|
||||
|
||||
default (T.Text)
|
||||
|
||||
data BinaryCheck = BinaryCheck
|
||||
{ filePath :: FilePath
|
||||
, zeroExitCode :: Bool
|
||||
, versionPresent :: Bool
|
||||
}
|
||||
data BinaryCheck =
|
||||
BinaryCheck
|
||||
{ filePath :: FilePath
|
||||
, zeroExitCode :: Bool
|
||||
, versionPresent :: Bool
|
||||
}
|
||||
|
||||
-- | Construct regex: [^\.]*${version}\.*\s*
|
||||
versionRegex :: Text -> RE' ()
|
||||
@ -41,7 +42,7 @@ checkTestsBuild attrPath =
|
||||
(T.unpack attrPath) ++ ".tests or {}"
|
||||
]
|
||||
in catchany_sh
|
||||
(do Shell.canFail $ Shelly.run "nix-build" (map T.pack nixBuildCmd)
|
||||
(do _ <- Shell.canFail $ Shelly.run "nix-build" (map T.pack nixBuildCmd)
|
||||
code <- lastExitCode
|
||||
return $ code == 0)
|
||||
(\_ -> return False)
|
||||
|
@ -8,8 +8,6 @@ import qualified Data.Text as T
|
||||
import Data.Time.Clock (UTCTime, addUTCTime, getCurrentTime)
|
||||
import Data.Time.Format (defaultTimeLocale, formatTime, iso8601DateFormat)
|
||||
|
||||
-- $setup
|
||||
-- import Data.Time.Format (parseTimeOrError)
|
||||
data Time m a where
|
||||
Now :: Time m UTCTime
|
||||
|
||||
@ -28,6 +26,7 @@ runPure t =
|
||||
-- | Return the UTC time 1 hour ago
|
||||
--
|
||||
-- $setup
|
||||
-- >>> import Data.Time.Format (parseTimeOrError)
|
||||
-- >>> let exampleCurrentTime = parseTimeOrError False defaultTimeLocale "%Y-%-m-%-d" "2019-06-06" :: UTCTime
|
||||
--
|
||||
-- Examples:
|
||||
|
Loading…
Reference in New Issue
Block a user