toodles 0.1.1 → 0.1.2
raw patch · 3 files changed
+39/−7 lines, 3 files
Files
- README.md +24/−0
- app/Server.hs +14/−6
- toodles.cabal +1/−1
README.md view
@@ -108,11 +108,21 @@ ``` #### Running with Docker +You can run a pre-built toodles for your current directory via docker:++```bash+# execute toodles for the directory you are currently in:+$ docker run -it -v $(pwd):/repo -p 9001:9001 aviaviavi/toodles+```++Just mount your project into the container's `/repo` and direct a port of your choice to the container's `9001`.+ For convenience this repository also provides a `Dockerfile` to automatically build toodles. ```bash # to build container run:+$ cd /path/to/toodles/repo $ docker build -t toodles . # afterwards you can run the following command to execute toodles for the # directory you are currently in:@@ -134,4 +144,18 @@ */ ```++### Contributing++Contributions in any form are welcome! A few bits of info:++- Don't be shy, ask questions! Contributing to Toodles should be welcoming for+ people at any level of programming familiarity. Whether it's a new feature,+ bug fix, or docs, any contribution is very appreciated.+- Before you start coding, please comment or mark a particular issue as "in+ progress", or even open your pull request as a work in progress (WIP). This is+ to help avoid having multiple people work on the same thing.+- If github issues don't cut it, feel free to reach out on twitter+ [@avi_press](https://twitter.com/avi_press)+
app/Server.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-}+ {-# LANGUAGE TypeOperators #-} module Server where@@ -16,6 +17,7 @@ import Control.Monad import Control.Monad.IO.Class import Data.Aeson (FromJSON)+import Data.Aeson.Types import Data.Either import Data.IORef import Data.List (find, nub)@@ -24,7 +26,6 @@ import Data.Text (Text) import qualified Data.Text as T import qualified Data.Yaml as Y-import GHC.Generics (Generic) import Servant import System.Directory import System.IO.HVFS@@ -39,8 +40,15 @@ data ToodlesConfig = ToodlesConfig { ignore :: [FilePath] , flags :: [UserFlag]- } deriving (Show, Generic, FromJSON)+ } deriving (Show) +instance FromJSON ToodlesConfig where+ parseJSON (Object o) = do+ parsedIgnore <- o .:? "ignore" .!= []+ parsedFlags <- o .:? "flags" .!= []+ return $ ToodlesConfig parsedIgnore parsedFlags+ parseJSON invalid = typeMismatch "Invalid config" invalid+ app :: ToodlesState -> Application app s = serve toodlesAPI server @@ -143,10 +151,10 @@ listIfNotNull s = [s] renderFlag :: Flag -> Text- renderFlag TODO = "TODO"- renderFlag FIXME = "FIXME"- renderFlag XXX = "XXX"- renderFlag (UF (UserFlag x)) = x+ renderFlag TODO = "TODO"+ renderFlag FIXME = "FIXME"+ renderFlag XXX = "XXX"+ renderFlag (UF (UserFlag x)) = x -- | Given a function to emit new lines for a given todo, write that update in -- place of the current todo lines
toodles.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: toodles-version: 0.1.1+version: 0.1.2 license: MIT license-file: LICENSE copyright: 2018 Avi Press