packages feed

lentil 0.1.2.0 → 0.1.2.1

raw patch · 8 files changed

+53/−54 lines, 8 files

Files

README view
@@ -8,7 +8,7 @@  Manual, installation info can be found in: -    /doc/usr/+    ./doc/usr/  or at: 
changes.txt view
@@ -1,3 +1,10 @@+0.1.2.1+-------++- Released Wed 24 Jun 2015 05:45:47 CEST+- fixed bug: flagwords (todo, fixme, etc.) will be picked up as part of an+  issue only when they come at the beginning of a line.+ 0.1.2.0 ------- 
issues.txt view
@@ -1,9 +1,3 @@-changes.txt-    14  issues now get a free [xxx] [fixme]-    33  something <-- is valid now) - more languages available (c++, java,-        javascript, python, ruby) - fixed end-of-file bug and double quote-        string literal-  doc/dev/issues.txt     10  from String to Text? [feature:advanced]     11  colorise output on regexps? [feature:advanced]@@ -35,17 +29,10 @@     37  make it lazy in ouputting todos [refactor]     38  way to 'group' (section) output by tag [feature:advanced]  -doc/dev/sm.txt-    13  issue from something like-    15  take the dog out for a walk [refactor]-    19  #301 take the dog out for a walk [refactor]-    25  referring to this, and another part editable freely.-  src/Lentil/Args.hs     23  disambiguation optparse-applicative [feature:intermediate]     24  help as lentil PATH [ PATH... ] [ OPTIONS ] [feature:intermediate]     89  uncomment and implement sorting [feature:intermediate]-   100  sort parsing? [feature:intermediate]   src/Lentil/File.hs     51  combine funziona su windows? [feature:intermediate]@@ -54,11 +41,12 @@     23  e che fare quando il todo segue un * come nei commenti lunghi c?         [design]     63  add this to (ciString ancillaries?) [refactor]-   111  usa spaces non ' ' [fixme]-   154  specifica meglio [fixme]+   114  usa spaces non ' ' [fixme]+   156  specifica meglio [fixme]   src/Lentil/Parse/Run.hs     31  a function String -> [Issue]+    72  change '\n' trick [refactor] [duct]   src/Lentil/Parse/Syntaxes.hs     19  add langparsers che sia estensibile e leggibile a compilazione
lentil.cabal view
@@ -1,5 +1,5 @@ name:                lentil-version:             0.1.2.0+version:             0.1.2.1 synopsis:            frugal issue tracker description:         minumum effort, cohesive issue tracker based on                      ubiquitous @TODO@s and @FIXME@s conventions.
src/Lentil/Parse/Issue.hs view
@@ -105,8 +105,11 @@ -------------  -- optional ws + flagwords (case unsensitive) + optional ':' ++ optional1 ws+-- incipit have to be bound at the beginning of line (won't pick up stuff+-- in the middle of a sentence) incipit :: ParIssue FlagWord-incipit = fwpar               >>= \fw ->+incipit = char '\n' >> spaces >>+          fwpar               >>= \fw ->           optional (char ':') >>           many1 (char ' ')    >> -- fixme usa spaces non ' '           return fw@@ -147,10 +150,9 @@ freeText :: ParIssue Description freeText = fmap htmlify (manyTill anyChar end) <?> "free text"     where vp p      = try . parsecMap (const ()) $ p-          nlInc     = char '\n' *> spaces >> incipit           end       = lookAhead $ choice [vp (spaces *> tag),                                           vp blankline,-                                          vp nlInc,+                                          vp incipit,                                           vp eof] -- fixme specifica meglio  tags :: ParIssue [Tag]
src/Lentil/Parse/Run.hs view
@@ -69,9 +69,13 @@ parIssues :: FilePath -> [Comment] -> IO [Issue] parIssues fp cs = concat <$> mapM (parIssue fp) cs +-- todo change '\n' trick [refactor] [duct]+-- why '\n'? see setRow comment parIssue :: FilePath -> Comment -> IO [Issue]-parIssue fp (r, t) = runParIO (setRow r >> issues) fp t+parIssue fp (r, t) = runParIO (setRow r >> issues) fp ('\n':t) +-- why (r-1)? Every TODO must start on a newline, so we have to add a top+-- '\n' in case there immediately  is one setRow :: Row -> ParIssue ()-setRow r = getPosition >>= setPosition . flip setSourceLine r+setRow r = getPosition >>= setPosition . flip setSourceLine (r-1) 
src/Main.hs view
@@ -28,7 +28,7 @@                                    short 'v'      <>                                    help "show version and copyright info" )     where-          versionCopy = "lentil - a frugal issue tracker, version 0.1.2.0\n\+          versionCopy = "lentil - a frugal issue tracker, version 0.1.2.1\n\                         \(C) 2015 Francesco Ariis - http://www.ariis.it\n\                         \released under the GNU General Public License 3\n" 
test/Lentil/Parse/IssueSpec.hs view
@@ -57,17 +57,17 @@    describe "incipit" $ do     it "parses the initial section of an issue, returns nothing" $-       do sp incipit "TODO: "  `shouldBe` Just Todo-          sp incipit "FIXME: "  `shouldBe` Just Fixme-          sp incipit "XXX: "  `shouldBe` Just Xxx+       do sp incipit "\n TODO: "  `shouldBe` Just Todo+          sp incipit "\n FIXME: "  `shouldBe` Just Fixme+          sp incipit "\nXXX: "  `shouldBe` Just Xxx     it "doesn't work without previous newline" $-      sp incipit "TODO:some"  `shouldBe` Nothing+      sp incipit "\nTODO:some"  `shouldBe` Nothing     it "doesn't work if you don't add a space after :" $-      sp incipit "TODO:some"  `shouldBe` Nothing+      sp incipit "\nTODO:some"  `shouldBe` Nothing     it "does allow you to omit the :" $-      sp incipit "xxx some"  `shouldBe` Just Xxx+      sp incipit "\nxxx some"  `shouldBe` Just Xxx     it "is case unsensitive in flag-word" $-      sp incipit "tOdO some"  `shouldBe` Just Todo+      sp incipit "\ntOdO some"  `shouldBe` Just Todo     it "doesn't allow anything before flag-words" $       sp incipit "so fixme someday"  `shouldBe` Nothing     it "fails if we are not at the beginning of line" $@@ -101,39 +101,37 @@    describe "issue" $ do     it "parses an issue" $-      sp issue "fixMe this is it [t] [f:w]"-         `shouldBe` (Just $ Issue "<f>" 1 "this is it"+      sp issue "\n fixMe this is it [t] [f:w]"+         `shouldBe` (Just $ Issue "<f>" 2 "this is it"                                   [Tag "fixme", Tag "t", Tag "f:w"])     it "parses tagless/fieldless issues too" $-      sp issue "TODO: this is it\n"-         `shouldBe` (Just $ Issue "<f>" 1 "this is it" [])+      sp issue "\nTODO: this is it\n"+         `shouldBe` (Just $ Issue "<f>" 2 "this is it" [])     it "parses an issue not ended by \\n" $-      sp issue "todo block1 "-         `shouldBe` (Just $ Issue "<f>" 1 "block1" [])+      sp issue "\ntodo block1 "+         `shouldBe` (Just $ Issue "<f>" 2 "block1" [])     it "doesn't display the eventual \n at eof" $-      sp issue "TOdO: this is it\n"-         `shouldBe` (Just $ Issue "<f>" 1 "this is it" [])+      sp issue "\nTOdO: this is it\n"+         `shouldBe` (Just $ Issue "<f>" 2 "this is it" [])     it "doesn't accept a lone (naked) todo" $-      sp issue "todo\n"+      sp issue "\ntodo\n"          `shouldBe` Nothing     it "issues declared with fixme get a free [fixme] tag" $-      sp issue "fixme blah\n"-         `shouldBe` (Just $ Issue "<f>" 1 "blah" [Tag "fixme"])+      sp issue "\nfixme blah\n"+         `shouldBe` (Just $ Issue "<f>" 2 "blah" [Tag "fixme"])    describe "issues" $ do     it "parses multiple issues" $-      sp issues "TODO: this is it [f:w]\n TODO: hey [t]"-         `shouldBe` Just [Issue "<f>" 1 "this is it" [Tag "f:w"],-                          Issue "<f>" 2 "hey" [Tag "t"]]-    it "parse multiple issues if on the same line" $-      sp issues "TODO: this is it [f:w] TODO: hey [t]"-         `shouldBe` Just [Issue "<f>" 1 "this is it" [Tag "f:w"],-                          Issue "<f>" 1 "hey" [Tag "t"]]-    it "don't parse multiple issues on the same line if not ended by tags" $-      sp issues "TODO: this is it todo hey [t]"-         `shouldBe` Just [Issue "<f>" 1 "this is it todo hey" [Tag "t"]]+      sp issues "\nTODO: this is it [f:w]\n TODO: hey [t]"+         `shouldBe` Just [Issue "<f>" 2 "this is it" [Tag "f:w"],+                          Issue "<f>" 3 "hey" [Tag "t"]]+    it "doesn't parse multiple issues if on the same line" $+      sp issues "\nTODO: this is it [f:w] TODO: hey [t]"+         `shouldBe` Just [Issue "<f>" 2 "this is it" [Tag "f:w"]]     it "parses two issues, tagless, if the second starts on nl" $-      sp issues "TODO: this is it \n  todo hey [t]"-         `shouldBe` Just [Issue "<f>" 1 "this is it" [],-                          Issue "<f>" 2 "hey" [Tag "t"]]+      sp issues "\nTODO: this is it \n  todo hey [t]"+         `shouldBe` Just [Issue "<f>" 2 "this is it" [],+                          Issue "<f>" 3 "hey" [Tag "t"]]+    it "doesn't pick issues in the middle of a sentence" $+      sp issues "\nthis is not a todo as you can see" `shouldBe` (Just [])