diff --git a/.toodles.yaml b/.toodles.yaml index 35f211e..8923faa 100644 --- a/.toodles.yaml +++ b/.toodles.yaml @@ -2,5 +2,5 @@ # Toodles will ignore a file that matches any of the entires ignore: - - test.js - - stack-work +- test.js +- stack-work diff --git a/app/Main.hs b/app/Main.hs index 85c67a3..a9625d8 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -12,7 +12,7 @@ import qualified Control.Exception as E import Control.Monad import Control.Monad.IO.Class import Data.Aeson -import qualified Data.ByteString.Lazy.Char8 as B8S +import qualified Data.ByteString.Char8 as B8SS import Data.Either import Data.IORef import Data.List @@ -23,6 +23,7 @@ import Data.String.Utils import qualified Data.Text as T import Data.Version (showVersion) import Data.Void +import qualified Data.Yaml as Y import GHC.Generics import Network.Wai.Handler.Warp import Paths_toodles @@ -464,7 +465,7 @@ ignoreFile (ToodlesConfig ignoredPaths) file = let p = T.pack file in T.isInfixOf "node_modules" p || T.isSuffixOf "pb.go" p || T.isSuffixOf "_pb2.py" p || - any (\regex -> file =~ regex) ignoredPaths + any (\r -> file =~ r :: Bool) ignoredPaths getExtension :: FilePath -> T.Text getExtension path = last $ T.splitOn "." (T.pack path) @@ -516,10 +517,13 @@ runFullSearch :: ToodlesArgs -> IO TodoListResult runFullSearch userArgs = let projectRoot = directory userArgs in do + putStrLn $ "configPath: " ++ projectRoot ++ "/.toodles.yaml" configExists <- doesFileExist $ projectRoot ++ "/.toodles.yaml" config <- if configExists - then eitherDecode' . B8S.pack <$> readFile (projectRoot ++ "/.toodles.yaml") + then Y.decodeEither' . B8SS.pack <$> readFile (projectRoot ++ "/.toodles.yaml") else return . Right $ ToodlesConfig [] + when (isLeft config) + $ putStrLn $ "[WARNING] Invalid .toodles.yaml: " ++ show config allFiles <- getAllFiles (fromRight (ToodlesConfig []) config) projectRoot let parsedTodos = concatMap runTodoParser allFiles filteredTodos = diff --git a/package.yaml b/package.yaml index 980f88c..ce54595 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: toodles -version: 0.1.0.2 +version: 0.1.0.3 github: "aviaviavi/toodles" license: MIT author: "Avi Press" @@ -9,6 +9,8 @@ category: Project Management extra-source-files: - README.md + +data-files: - web/js/app.js - web/js/* - web/html/* diff --git a/toodles.cabal b/toodles.cabal index f5d869e..1171592 100644 --- a/toodles.cabal +++ b/toodles.cabal @@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: 0c94110ed79d4a78056d1cae812a11d9a0d804c4c24304ced9b15ea51db5d3db +-- hash: 703679257a67bc8f02883cf8b85e4c1c53a777ac55e49065b72d92d2c829fb2b name: toodles -version: 0.1.0.2 +version: 0.1.0.3 synopsis: Manage the TODO entries in your code description: See the README on GitHub at category: Project Management @@ -19,6 +19,7 @@ build-type: Simple cabal-version: >= 1.10 extra-source-files: README.md +data-files: web/css/bulma.min.css web/css/font-awesome.min.css web/css/toodles.css diff --git a/web/js/app.js b/web/js/app.js index bc0ef3e..2c604b2 100644 --- a/web/js/app.js +++ b/web/js/app.js @@ -64,8 +64,7 @@ $(document).ready(function() { }) }.bind(this) }, -// TODO(avi|p=2|key=a val) - make sorts persist refreshes -// TODO(avi|p=2|key=a val) - make sorts persist refreshes + // TODO(avi|p=2|key=a val) - make sorts persist refreshes sortTodos: function(sortField) { if (!sortField || typeof sortField !== 'string') { sortField = this.customSortSelected