neil 0.1 → 0.2
raw patch · 4 files changed
+10/−10 lines, 4 filesdep ~extra
Dependency ranges changed: extra
Files
- neil.cabal +2/−2
- src/Cabal.hs +6/−6
- src/Git.hs +1/−1
- src/Travis.hs +1/−1
neil.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: neil-version: 0.1+version: 0.2 license: BSD3 license-file: LICENSE category: Development@@ -23,7 +23,7 @@ library hs-source-dirs: src- build-depends: base == 4.*, filepath, directory, time, process, extra+ build-depends: base == 4.*, filepath, directory, time, process, extra >= 0.3 exposed-modules: Neil
src/Cabal.hs view
@@ -87,8 +87,8 @@ run Docs{..} = Just $ do src <- readCabal- let [ver] = [strip $ drop 8 x | x <- lines src, "version:" `isPrefixOf` x]- let [name] = [strip $ drop 5 x | x <- lines src, "name:" `isPrefixOf` x]+ let [ver] = [trim $ drop 8 x | x <- lines src, "version:" `isPrefixOf` x]+ let [name] = [trim $ drop 5 x | x <- lines src, "name:" `isPrefixOf` x] cmd $ "cabal haddock --hoogle --hyperlink-source " ++ "--contents-location=/package/" ++ name withTempDir $ \dir -> do@@ -154,12 +154,12 @@ project <- takeBaseName . fromMaybe (error "Couldn't find cabal file") <$> findCabal src <- fmap lines readCabal test <- testedWith- let grab tag = [stripStart $ drop (length tag + 1) x | x <- relines src, (tag ++ ":") `isPrefixOf` x]+ let grab tag = [trimStart $ drop (length tag + 1) x | x <- relines src, (tag ++ ":") `isPrefixOf` x] license <- readFile' $ concat $ grab "license-file" let bad = ["Incorrect declaration style: " ++ x- | (x,':':_) <- map (break (== ':') . stripStart) src- , not $ any isSpace $ strip x, not $ "http" `isSuffixOf` x || "https" `isSuffixOf` x+ | (x,':':_) <- map (break (== ':') . trimStart) src+ , not $ any isSpace $ trim x, not $ "http" `isSuffixOf` x || "https" `isSuffixOf` x , not $ all (\x -> isLower x || x == '-') x] ++ ["2014 is not in the copyright year" | not $ "2014" `isInfixOf` concat (grab "copyright")] ++ ["copyright string is not at the start of the license" | not $ concat (grab "copyright") `isInfixOf` concat (take 1 $ lines license)] ++@@ -175,7 +175,7 @@ relines :: [String] -> [String] relines (x:xs) | ":" `isSuffixOf` x = unwords (x:a) : relines b- where (a,b) = break (\x -> stripStart x == x) xs+ where (a,b) = break (\x -> trimStart x == x) xs relines (x:xs) = x : relines xs relines [] = []
src/Git.hs view
@@ -59,7 +59,7 @@ run Tag = Just $ do src <- readCabal- let [ver] = [strip $ drop 8 x | x <- lines src, "version:" `isPrefixOf` x]+ let [ver] = [trim $ drop 8 x | x <- lines src, "version:" `isPrefixOf` x] putStrLn $ "Confirm to tag the release with version " ++ ver ++ "? Type 'yes':" "yes" <- getLine cmd "git push"
src/Travis.hs view
@@ -41,7 +41,7 @@ forM_ jobs $ \i -> do putChar '.' src <- wget wait $ "https://s3.amazonaws.com/archive.travis-ci.org/jobs/" ++ i ++ "/log.txt"- let want = [x | x <- lines $ reps '\r' '\n' src, any (`isPrefixOf` x) rel]+ let want = [x | x <- lines $ replace "\r" "\n" src, any (`isPrefixOf` x) rel] addEntry num time want when (null jobs) $ addEntry num time [] putStrLn "\nDone!"