checkmate 0.2.0 → 0.2.1
raw patch · 7 files changed
+39/−18 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +18/−0
- checkmate.cabal +1/−1
- src/Checkmate/Parser/IndentBlock.hs +8/−5
- src/Checkmate/Renderer.hs +5/−5
- test/Checkmate/DiscoverSpec.hs +1/−1
- test/Checkmate/Parser/IndentBlockSpec.hs +3/−3
- test/Checkmate/RendererSpec.hs +3/−3
CHANGELOG.md view
@@ -1,6 +1,24 @@ Checkmate changelog =================== +Version 0.2.1+-------------++Released on September 26, 2017.++ - Fixed a parser bug which had scanned continuous inline comments of+ unmatched styles, e.g.:++ // CHECK This line is scanned.+ // This line also is scanned.+ -- This line had been scanned, but the parser is fixed+ -- so that it isn't scanned anymore.++ - GitHub Flavored Markdown renderer (`checkmate gfm` and+ `Checkmate.Rendrer.toGFMarkdown`) became to ignore soft linebreaks to be+ consistent with CommonMark renderer.++ Version 0.2.0 -------------
checkmate.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: checkmate-version: 0.2.0+version: 0.2.1 synopsis: Generate checklists relevant to a given patch category: Development stability: alpha
src/Checkmate/Parser/IndentBlock.hs view
@@ -57,19 +57,22 @@ checkThenSpaces = do checkKeyword (char ':' >> someSpaces) <|> skipSome (oneOf " \t")- lineCommentStart :: Parser ()- lineCommentStart =- choice [void $ oneOf "#%'", void $ string "//", void $ string "--"]+ lineCommentStart :: Parser String+ lineCommentStart = choice+ [ do { c <- oneOf "#%'"; return [c] }+ , string "//"+ , string "--"+ ] lineCommentCheck :: Parser Text lineCommentCheck = do- lineCommentStart+ startSeq <- lineCommentStart someSpaces checkThenSpaces chars <- many $ noneOf "\n" nextLines <- many $ try $ do void eol someSpaces- lineCommentStart+ void $ string startSeq someSpaces many $ noneOf "\n" return $ stripEnd $ pack $ Data.List.unlines $ chars : nextLines
src/Checkmate/Renderer.hs view
@@ -13,13 +13,13 @@ import Checkmate.Check toCommonMark :: FilePath -> Int -> Checklist -> Text-toCommonMark = toCommonMark' ""+toCommonMark = toCommonMark' "" False toGFMarkdown :: FilePath -> Int -> Checklist -> Text-toGFMarkdown = toCommonMark' "[ ] "+toGFMarkdown = toCommonMark' "[ ] " True -toCommonMark' :: Text -> FilePath -> Int -> Checklist -> Text-toCommonMark' itemPrefix basePath headingLevel checklist = cat $+toCommonMark' :: Text -> Bool -> FilePath -> Int -> Checklist -> Text+toCommonMark' itemPrefix ignoreSoftBreak basePath headingLevel checklist = cat $ [heading, " Checklist \x1f914\n"] ++ [ cat $ (if i == (1 :: Int)@@ -28,7 +28,7 @@ ) ++ [ " - " , itemPrefix- , replace "\n" "\n " t+ , replace "\n" (if ignoreSoftBreak then " " else "\n ") t , "\n" ] | fileChecklist <- checks
test/Checkmate/DiscoverSpec.hs view
@@ -65,7 +65,7 @@ pyChecklistFixture :: FilePath -> Checklist pyChecklistFixture d = [ Check { checkScope = FileBlock { scopePath = pyPath- , scopeRange = SpanRange 2 24+ , scopeRange = SpanRange 2 25 } , checkOrderIndex = 1 , checkText = "module-level check"
test/Checkmate/Parser/IndentBlockSpec.hs view
@@ -63,11 +63,11 @@ (path, parsed) <- parse' pythonFixture let s = FileBlock path parsed `shouldParse`- [ Check (s $ SpanRange 2 24) 1 "module-level check"+ [ Check (s $ SpanRange 2 25) 1 "module-level check" , Check (s $ SpanRange 6 7) 2 "function-level check" , Check (s $ SpanRange 11 15) 3 "function-level check 2" , Check (s $ SpanRange 14 15) 4 "nested function-level check"- , Check (s $ SpanRange 19 24) 5 "class-level check"- , Check (s $ SpanRange 22 24) 6+ , Check (s $ SpanRange 19 25) 5 "class-level check"+ , Check (s $ SpanRange 23 25) 6 "method-level check.\nIt can be multiline." ]
test/Checkmate/RendererSpec.hs view
@@ -22,7 +22,8 @@ "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." , Check (FileBlock ("b" </> "foo" </> "bar" </> "baz.c") $ SpanRange 8 21) 1 "Ut enim ad minim veniam,"- , Check (FileBlock ("b" </> "foo" </> "bar" </> "baz.c") $ SpanRange 9 21) 2 $+ , Check (FileBlock ("b" </> "foo" </> "bar" </> "baz.c") $ SpanRange 9 21)+ 2 $ "quis nostrud exercitation ullamco laboris nisi ut\n" `append` "aliquip ex ea commodo consequat." ]@@ -59,6 +60,5 @@ #### `foo/bar/baz.c` - [ ] Ut enim ad minim veniam,- - [ ] quis nostrud exercitation ullamco laboris nisi ut- aliquip ex ea commodo consequat.+ - [ ] quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |]