lentil 0.1.7.1 → 0.1.8.0
raw patch · 12 files changed
+71/−5 lines, 12 files
Files
- changes.txt +7/−0
- doc/usr/page.rst +1/−0
- issues.txt +4/−1
- lentil.cabal +2/−1
- src/Lentil/Args.hs +1/−1
- src/Lentil/Export.hs +20/−0
- src/Lentil/Parse/Syntaxes.hs +4/−0
- src/Lentil/Types.hs +1/−1
- src/Main.hs +2/−1
- test/Lentil/ExportSpec.hs +15/−0
- test/Lentil/Parse/RunSpec.hs +3/−0
- test/test-files/lang-comm/xml.xml +11/−0
changes.txt view
@@ -1,3 +1,10 @@+0.1.8.0+-------++- Released Mon 23 Nov 2015 05:20:32 CET+- Xml, html parsing (patch by Mats Rauhala).+- Xml issue export (parch by Mats Rauhala).+ 0.1.7.1 -------
doc/usr/page.rst view
@@ -148,6 +148,7 @@ - perl source files (``.pl``, ``.pm``, ``.t``) - shell script source files (``.sh``) - nix source files (``.nix``)+- xml source files (``.xml``, ``.html``) - plain text files (``.txt``) If you want a file type ``.xyz`` to be recognised as one in the list above,
issues.txt view
@@ -37,6 +37,9 @@ 26 help as lentil PATH [ PATH... ] [ OPTIONS ] [feature:intermediate] 103 uncomment and implement sorting [feature:intermediate] +src/Lentil/Export.hs+ 36 maybe use a dedicated library to format xml? [design]+ src/Lentil/File.hs 41 not using canonised paths because it is extremely slow on big repositories (like darcs). Explore different possibilities@@ -52,7 +55,7 @@ src/Lentil/Parse/Syntaxes.hs 31 add langparsers che sia estensibile e leggibile a compilazione [u:2] [feature:intermediate]- 52 multiline signature? [lint]+ 53 multiline signature? [lint] src/Main.hs 41 leave sort out as now? [design]
lentil.cabal view
@@ -1,5 +1,5 @@ name: lentil-version: 0.1.7.1+version: 0.1.8.0 synopsis: frugal issue tracker description: minumum effort, cohesive issue tracker based on ubiquitous @TODO@s and @FIXME@s conventions.@@ -25,6 +25,7 @@ test/test-files/lang-comm/perl.pl, test/test-files/lang-comm/shell.sh, test/test-files/lang-comm/nix.nix,+ test/test-files/lang-comm/xml.xml, test/test-files/lang-comm/test.txt, test/test-files/lang-comm/text.txt, test/test-files/specific/contiguous.c,
src/Lentil/Args.hs view
@@ -66,7 +66,7 @@ ( short 'f' <> metavar "TYPE" <> value Pretty <>- help "output format (pretty, tagpop, csv, comp)" )+ help "output format (pretty, tagpop, csv, comp, xml)" ) where parseFormat :: String -> ReadM Format parseFormat s = let asl = map forTup (enumFrom minBound)
src/Lentil/Export.hs view
@@ -13,6 +13,7 @@ import Lentil.Types import qualified Data.List as L+import Data.Function (on) --------------- -- FUNCTIONS --@@ -31,6 +32,25 @@ where i2c i = (prettyFP . iFile) i ++ ":" ++ show (iRow i) ++ ":\n" ++ " " ++ iPPDesc i ++ " " ++ tags2StringPretty (iTags i) ++ "\n"++-- TODO: maybe use a dedicated library to format xml? [design]+-- xml output+issues2Xml :: [Issue] -> String+issues2Xml is = concat ["<issues>", concat (map is2x (groupBy is)), "</issues>", "\n"]+ where i2x i = concat ["<issue>",+ "<row>", show (iRow i), "</row>",+ maybe "" d2x (iDesc i),+ "<tags>", concat (map t2x (iTags i)), "</tags>",+ "</issue>"]+ d2x d = concat ["<description>", cdata d, "</description>"]+ t2x t = concat ["<tag>", tagString t, "</tag>"]+ is2x [] = ""+ is2x is'@(i:_) = let+ fp = file i+ in concat ["<file>", "<filename>", cdata fp, "</filename>", concat (map i2x is'), "</file>"]+ cdata x = concat ["<![CDATA[", x, "]]>"]+ file = prettyFP . iFile+ groupBy = L.groupBy ((==) `on` file) -----------------
src/Lentil/Parse/Syntaxes.hs view
@@ -45,6 +45,7 @@ | ext `elem` [".pl", ".pm", ".t"] = Just perl | ext `elem` [".sh"] = Just perl -- shell | ext `elem` [".nix"] = Just nix+ | ext `elem` [".xml", ".html"] = Just xml | ext `elem` [".txt"] = Just text | otherwise = Nothing where ext = map toLower (SF.takeExtension fp)@@ -53,6 +54,7 @@ haskell, c, javascript, pascal, python, ruby :: ParSource [CommentString] perl, nix :: ParSource [CommentString] text :: ParSource [CommentString]+xml :: ParSource [CommentString] haskell = source $ ParSyntax ["--"] [("{-", "-}")] ClangLike ['"'] ['\''] c = source $ ParSyntax ["//"] [("/*", "*/")]@@ -69,5 +71,7 @@ ClangLike ['"', '\''] [] nix = source $ ParSyntax ["#"] [("/*", "*/")] ClangLike ['"'] ['\'']+xml = source $ ParSyntax [] [("<!--", "-->")]+ ClangLike ['"', '\''] [] text = (:[]) . MultiLine 1 <$> many anyChar
src/Lentil/Types.hs view
@@ -32,7 +32,7 @@ aliasSign = "%" -- output format-data Format = TagPop | Pretty | Csv | Comp+data Format = TagPop | Pretty | Csv | Comp | Xml deriving (Show, Eq, Enum, Bounded) -- comp: as gcc/ghc would output warnings
src/Main.hs view
@@ -28,7 +28,7 @@ short 'v' <> help "show version and copyright info" ) where- versionCopy = "lentil - frugal issue tracker, version 0.1.7.1\n\+ versionCopy = "lentil - frugal issue tracker, version 0.1.8.0\n\ \(C) 2015 Francesco Ariis - http://www.ariis.it\n\ \released under the GNU General Public License v3\n" @@ -59,4 +59,5 @@ TagPop -> outFunction (ppPopularity bCol fil) Csv -> outFunction (issues2CSV fil) Comp -> outFunction (issues2Compiler fil)+ Xml -> outFunction (issues2Xml fil)
test/Lentil/ExportSpec.hs view
@@ -24,6 +24,17 @@ "file:2:", " db [e:f]"] +xml :: String+xml = concat $+ ["<issues><file><filename><![CDATA[file]]></filename>"+ , "<issue><row>1</row><description><![CDATA[da]]></description>"+ , "<tags><tag>a</tag><tag>c</tag></tags>"+ , "</issue>"+ , "<issue><row>2</row><description><![CDATA[db]]></description>"+ , "<tags><tag>e:f</tag></tags>"+ , "</issue>"+ , "</file></issues>", "\n"]+ main :: IO () main = hspec spec @@ -45,4 +56,8 @@ describe "issues2Compiler" $ do it "exports issues to compiler-like output format" $ issues2Compiler is `shouldBe` cmp++ describe "issues2Xml" $ do+ it "exports issues to xml output format" $+ issues2Xml is `shouldBe` xml
test/Lentil/Parse/RunSpec.hs view
@@ -71,6 +71,9 @@ it "parses a Nix source" $ fileParser [] "test/test-files/lang-comm/nix.nix" `shouldReturn` spt "test/test-files/lang-comm/nix.nix"+ it "parses an Xml source" $+ fileParser [] "test/test-files/lang-comm/xml.xml"+ `shouldReturn` spt "test/test-files/lang-comm/xml.xml" it "parses a .xyz file as if it were a .c file" $ fileParser [(".xyz", ".c")] "test/test-files/lang-comm/xyz.xyz" `shouldReturn` spt "test/test-files/lang-comm/xyz.xyz"
+ test/test-files/lang-comm/xml.xml view
@@ -0,0 +1,11 @@+<!-- TODO: single comment -->++<!-- todo single2 -->++c = "st'ring" # string+letter = 'c' # char++<!-- todo block1+ TODO: block2 [tog] -->++# end