packages feed

lentil 1.5.6.0 → 1.5.7.0

raw patch · 12 files changed

+89/−99 lines, 12 filesdep +bytestring

Dependencies added: bytestring

Files

− authors.txt
@@ -1,23 +0,0 @@-(in alphabetical order)--Michał Antkiewi-Francesco Ariis-Damien Couroussé-Ben Franksen-Artyom Kazak-Anton Felix Lorenzen-Rodney Lorrimar-Francesco Mazzoli-Eric Mertens-Simon Michael-Luca Molteni-Luke Murphy-Qptain Nemo-Mats Rauhala-Stefano Rodighiero-Peter Simons-Henning Thielemann-Tomislav-Tuncer Ayaz-YongJoon Joe-Massimo Zaniboni
changes.txt view
@@ -1,3 +1,23 @@+1.5.7.0+-------++- Compiler output `-f comp` has been slightly tweaked to use screen+  space more efficiently, mainly by removing newlines between issues.+  Example before:+     alpha.hs:4:+        add prompt before getline, user might complain! [interface]++     alpha.hs:11:+        add a type signature to replace [lint]+  Example after:+     alpha.hs:4: add prompt before getline, user might complain! [interface]+     alpha.hs:11: add a type signature to replace [lint]+  (reported by Morgan Willcock)+- Encodings are now strict.+  Lentil will try to read files as utf-8 encoded, and failing that as+  latin-1.+  If you need support for more encodings, write to me.+ 1.5.6.0 ------- 
doc/usr/page.rst view
@@ -4,7 +4,7 @@ summary: lentil issue tracker user manual tags: lentil,issue,bug,issue tracker,bug tracker,manual published: 2015-06-09 00:00:00-revised: 2018-07-02 00:00:00+revised: 2023-03-14 00:00:00 --------------------------------------------------------------------------------  @@ -36,14 +36,19 @@ Installation ------------ -(if you don't want to compile it yourself, `binaries`_ are available)+(If you don't want to compile it yourself, these binaries are available:+`linux`_ ◇ `windows`_ ◇ `signed hashes`_.) -.. _`binaries`: http://ariis.it/link/repos/lentil/bin/+.. _`linux`: /static/dist/files/lentil-linux-x86_64.zip+.. _`windows`: /static/dist/files/lentil-windows-x86_64.zip+.. _`signed hashes`: /static/dist/page.html -lentil is written in Haskell, which you can easily grab from your-OS repository (e.g. for Debian users ``apt-get install-haskell-platform``). Once you do that, installing lentil is as easy as:+``lentil`` is written in Haskell, which you can easily grab from your+OS repository or `GHCup`_ (no root/admin needed). Once you do that,+installing lentil is as easy as: +.. _`GHCup`: https://www.haskell.org/ghcup/#+ ::    cabal update             # this might take a few minutes!@@ -289,11 +294,8 @@  :: -  alpha.hs:4:-     add prompt before getline, or the user might complain! [interface]--  alpha.hs:11:-     add a type signature to replace [lint]+  alpha.hs:4: add prompt before getline, or the user might complain! [interface]+  alpha.hs:11: add a type signature to replace [lint]  This is useful because it is recognised by editors like Emacs, which can turn them into active links to the relevant file/position.
− issues.txt
@@ -1,38 +0,0 @@-doc/dev/issues.txt-    11  check --output pretty, there are trailing white spaces [bug] [u:1]-    12  win (and mac?) builds [package] [u:2] [2017]-    13  Henning: don't output nothing on lentil xxx.cabal (maybe add 19-        skipped?) [request] [2017]- -src/Lentil/Export.hs-    54  markdown output - che genere di header? o lista di liste? - come-        mettere i tag? /[[cdsacad] [feature] [u:3] [cdsac]- -src/Lentil/File.hs-    69  combine funziona su windows? [test]- -src/Lentil/Parse/Run.hs-   147  Row should be carried on by issues, not be manually set! [refactor]- -src/Lentil/Parse/Syntaxes.hs-    25  qptain_nemo fake multiline comments in C (i.e. // and \ at the-        bottom of the line, continued into next line, are valid C comments-        but not recognised by lentil [u:1] [request]-    31  (Iustin Pop) export to markdown. [u:1] [request]-    32  scanner for yesod templates (hamlet/julius/casius) which are a bit-        difficult since they are html/js/css + embedded Haskell. [u:1]-        [request]-    36  Consider using https://github.com/github/semantic ? [design]-    45  lowercase does not work (not recognised, .r vs. .R) [bug]-   120  rst parser doesn't respect whitespace or paragraphs. How to-        implement this without breaking other parsers? [bug] [design]- -src/Main.hs-    14  ignore dist dist-newstyle and common folders [feature:basic]-    15  help su `lentil` più semplie (`use lentil .`) [feature:basic]-    16  lentil con lexer? [design]-    17  lentil <-- invoke with lentil . or lentil --help [feature:basic]- -test/Lentil/FileSpec.hs-    34  do not allow duplicate issues [bug]-    39  excluding files fails on MS Windows! Check why! [u:3] [bug]
lentil.cabal view
@@ -1,6 +1,6 @@ cabal-version:       3.0 name:                lentil-version:             1.5.6.0+version:             1.5.7.0 synopsis:            frugal issue tracker description:         minumum effort, cohesive issue tracker based on                      ubiquitous @TODO@s and @FIXME@s conventions.@@ -42,6 +42,7 @@                      test/test-files/lang-comm/latex.tex,                      test/test-files/specific/contiguous.c,                      test/test-files/specific/cont-custom.c,+                     test/test-files/specific/latin1.c,                      test/test-files/specific/xyz.xyz,                      test/test-files/specific/custom-fwords.c,                      test/test-files/test-proj/base-case/fold-a/foo1.hs,@@ -56,8 +57,7 @@                      test/test-files/test-proj/upper/prova2.cPp,                      test/test-files/test-proj/upper/prova3.Cpp,                      test/test-files/test-proj/upper/prova.F-extra-doc-files:     README, changes.txt, doc/usr/page.rst, doc/usr/test.zip,-                     issues.txt, authors.txt+extra-doc-files:     README, changes.txt, doc/usr/page.rst, doc/usr/test.zip  flag developer   description: developer mode - warnings let compilation fail@@ -68,6 +68,7 @@ executable lentil   main-is:             Main.hs   build-depends:       base >= 4.9 && < 5.0,+                       bytestring == 0.12.*,                        prettyprinter == 1.7.*,                        prettyprinter-ansi-terminal >= 1.1.3 && < 1.2,                        csv==0.1.*,@@ -75,14 +76,14 @@                        dlist >= 0.8 && < 1.1,                        directory    >= 1.2 && < 1.4,                        filemanip==0.3.*,-                       filepath==1.4.*,-                       megaparsec >= 8.0 && < 9.5,+                       filepath >=1.4 && <1.6,+                       megaparsec >= 8.0 && < 9.7,                        mtl >=2.2 && <2.4,                        natural-sort==0.1.*,                        optparse-applicative >= 0.16 && < 0.19,                        regex-tdfa >= 1.2 && < 1.4,                        semigroups >= 0.18 && < 0.21,-                       text >=1.2 && <2.1,+                       text >=1.2 && <2.2,                        terminal-progress-bar==0.4.*   other-modules:       Lentil.Types, Lentil.Args, Lentil.File, Lentil.Print,                        Lentil.Query, Lentil.Export, Lentil.Parse.Source,@@ -105,6 +106,7 @@   HS-Source-Dirs:      test, src   main-is:             Tests.hs   build-depends:       base >= 4.9 && < 5.0,+                       bytestring == 0.12.*,                        prettyprinter == 1.7.*,                        prettyprinter-ansi-terminal >= 1.1.3 && < 1.2,                        csv==0.1.*,@@ -112,14 +114,14 @@                        deepseq >=1.4 && <1.6,                        dlist >= 0.8 && < 1.1,                        filemanip==0.3.*,-                       filepath==1.4.*,-                       megaparsec >= 8.0 && < 9.5,+                       filepath >=1.4 && <1.6,+                       megaparsec >= 8.0 && < 9.7,                        mtl >=2.2 && <2.4,                        natural-sort==0.1.*,                        optparse-applicative >= 0.16 && < 0.19,                        regex-tdfa >= 1.2 && < 1.4,                        semigroups >= 0.18 && < 0.21,-                       text >=1.2 && <2.1,+                       text >=1.2 && <2.2,                        terminal-progress-bar==0.4.*                        -- same as above, plus hspec                        , hspec      >= 2.3 && < 2.12
src/Lentil/Export.hs view
@@ -28,10 +28,9 @@  -- compiler-like (gcc/ghc) warnings, parseable by emacs issues2Compiler :: [Issue] -> String-issues2Compiler is = L.intercalate "\n" (map i2c is)-    where i2c i = (prettyFP . iFile) i ++ ":" ++ show (iRow i) ++ ":\n" ++-                  "   " ++ iPPDesc i ++ " " ++-                  tags2StringPretty (iTags i) ++ "\n"+issues2Compiler is = concatMap i2c is+    where i2c i = (prettyFP . iFile) i ++ ":" ++ show (iRow i) ++ ": " +++                  iPPDesc i ++ " " ++ tags2StringPretty (iTags i) ++ "\n"  -- xml output issues2Xml :: [Issue] -> String
src/Lentil/File.hs view
@@ -16,7 +16,6 @@  import System.FilePath import System.FilePath.Find-import Control.Applicative import Data.Semigroup as S import Data.Monoid as M () 
src/Lentil/Parse/Run.hs view
@@ -21,15 +21,16 @@  import Text.Megaparsec -import qualified Control.Exception    as E import qualified Control.DeepSeq      as DS import qualified Control.Monad        as CM import qualified Control.Monad.Reader as R import qualified Control.Monad.Trans  as T+import qualified Data.ByteString      as B import qualified Data.DList           as D import qualified Data.IORef           as I+import qualified Data.Maybe           as M import qualified Data.Text            as T-import qualified Data.Text.IO         as TI+import qualified Data.Text.Encoding   as TE import qualified Data.Text.Lazy       as TL import qualified System.Directory     as D import qualified System.ProgressBar   as PB@@ -200,10 +201,29 @@ rperr :: String -> Runner () rperr s = T.liftIO $ perr s +-- todo Do not use String, but Text. [u:1]+-- todo Add a proper testing interface [u:2]+++-- Try system locale, then utf-8 it if fails, then latin-1 as a last ditch. safeRead :: FilePath -> IO String-safeRead fp = E.try (TI.readFile fp) >>= \case-                Right t -> return (T.unpack t)-                Left x  -> perr (fp ++ " : " ++ show (x :: E.IOException) ++-                                 " -- ignoring file") >>-                           return ""+safeRead fp = do+        -- We are *not* relying on system locale here, just+        -- trying a number of popular encodings for source files.+        b <- B.readFile fp+        case decodeMulti decoders b of+          Nothing -> perr (fp ++ ": unrecognised encoding.") >>+                     return ""+          Just t -> return (T.unpack t)+    where+        decodeMulti :: [B.ByteString -> Maybe T.Text] ->+                       B.ByteString -> Maybe T.Text+        decodeMulti wds b =+          case M.mapMaybe ($ b) wds of+            [] -> Nothing+            (t:_) -> Just t +        decoders :: [B.ByteString -> Maybe T.Text]+        decoders =+          [(\b -> either (const Nothing) Just (TE.decodeUtf8' b)), -- utf8.+           (\b -> Just (TE.decodeLatin1 b))] -- latin-1 (for Windows).
src/Main.hs view
@@ -44,7 +44,7 @@                                    short 'v'      S.<>                                    help "show version and copyright info" )     where-          versionCopy = "\nlentil - frugal issue tracker, version 1.5.6.0\n\+          versionCopy = "\nlentil - frugal issue tracker, version 1.5.7.0\n\                         \(C) 2015-2021 Francesco Ariis - http://www.ariis.it\n\                         \released under the GNU General Public License v3\n" 
test/Lentil/ExportSpec.hs view
@@ -18,11 +18,8 @@  cmp :: String cmp = unlines-        ["file:1:",-         "   da [a] [c]",-         "",-         "file:2:",-         "   db [e:f]"]+        ["file:1: da [a] [c]",+         "file:2: db [e:f]"]  xml :: String xml = concat
test/Lentil/Parse/RunSpec.hs view
@@ -48,6 +48,10 @@         let custFlw fp = [Issue fp 3 (Just "single2") [Tag "hax"]] in         fileParser [] ["hAx"] "test/test-files/specific/custom-fwords.c"             `shouldReturn` custFlw "test/test-files/specific/custom-fwords.c"+    it "does not fail with latin1 (ISO-8859) encoding" $+        fileParser [] [] "test/test-files/specific/latin1.c"+            `shouldReturn` [Issue "test/test-files/specific/latin1.c" 1+                                  (Just "single") []]    describe "commentParser - languages" $ do     it "parses a plain text source" $
+ test/test-files/specific/latin1.c view
@@ -0,0 +1,8 @@+// todo single++int main () {+    somefun(5, "acca");+    // ñ (latin-1)+}++//  end