tomlcheck 0.1.0.0 → 0.1.0.1
raw patch · 8 files changed
+104/−41 lines, 8 filesdep ~htoml-megaparsecPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: htoml-megaparsec
API changes (from Hackage documentation)
- Lib: exec :: IO ()
- Lib: instance GHC.Generics.Generic Lib.Program
- Lib: instance Options.Generic.ParseRecord Lib.Program
+ Toml.Checker: exec :: IO ()
+ Toml.Checker: instance GHC.Generics.Generic Toml.Checker.Program
+ Toml.Checker: instance Options.Generic.ParseRecord Toml.Checker.Program
Files
- .travis.yml +9/−2
- Justfile +29/−0
- README.md +28/−2
- app/Main.hs +1/−1
- src/Lib.hs +0/−32
- src/Toml/Checker.hs +32/−0
- stack.yaml +1/−1
- tomlcheck.cabal +4/−3
.travis.yml view
@@ -39,8 +39,16 @@ - stack --no-terminal build --haddock --no-haddock-deps - hlint . - weeder .- - export BINPATH="$(find -name tomlcheck -executable | tail -n2 | head -n1)"+ - |+ if [ `uname` = "Darwin" ]+ then+ export BINPATH="$(find . -name tomlcheck -perm 755 | tail -n1)"+ else+ export BINPATH="$(find -name tomlcheck -executable | tail -n2 | head -n1)"+ fi+ - echo $BINPATH - mv $BINPATH tomlcheck-$TARGET+ - ls tomlcheck-$TARGET deploy: api_key:@@ -53,5 +61,4 @@ branches: only:- - master - /\d+\.\d+\.\d+\.\d+.*$/
+ Justfile view
@@ -0,0 +1,29 @@+clean:+ sn c .+ rm -f lol.html++lol:+ bench "sn help" "tomlcheck --file data/example.toml" --output lol.html++next:+ @export VERSION=$(cat tomlcheck.cabal | grep -P -o '\d+\.\d+\.\d+\.\d+' tomlcheck.cabal | head -n1 | awk -F. '{$NF+=1; print $0}' | sed 's/ /\./g') && echo $VERSION && sed -i "2s/[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/$VERSION/" tomlcheck.cabal++bench:+ bench "tomlcheck --file data/example.toml" "tomlcheck --file data/good.toml"++upload:+ rm -rf dist/+ cabal sdist+ cabal upload $(fd '.tar.gz$' -IH) --publish++install:+ cabal new-build+ cp $(fd -IH 'tomlcheck$' | tail -n1) ~/.local/bin++release:+ git tag "$(grep -P -o '\d+\.\d+\.\d+\.\d+' tomlcheck.cabal | head -n1)"+ git push origin --tags+ github-release edit -s $(cat .git-token) -u vmchale -r tomlcheck -n $(madlang run ~/programming/madlang/releases/releases.mad) -t "$(grep -P -o '\d+\.\d+\.\d+\.\d+' tomlcheck.cabal | head -n1)"++check:+ git diff master origin/master
README.md view
@@ -11,14 +11,40 @@ ### Binaries -Head over to the [release page](link goes here) to see if your platform has+Head over to the [release page](https://github.com/vmchale/tomlcheck/releases) to see if your platform has binaries. Simply put it somewhere on your path. ### Cabal -Install [GHC & cabal](https://www.haskell.org/downloads#minimal), then+Install [GHC](https://www.haskell.org/ghc/download.html) along with +[cabal](https://www.haskell.org/downloads#minimal), then ```bash $ cabal update $ cabal install tomlcheck+```++## Known Deficiencies++ * No Windows binaries+ * Slow on large files (>7000 lines)++## Cool Facts+ + * It's really fast+ * It uses laziness to make checking schnell yet robust++```+-------------------------------------------------------------------------------+ Language Files Lines Code Comments Blanks+-------------------------------------------------------------------------------+ Cabal 1 58 53 1 4+ Haskell 3 40 28 4 8+ Justfile 1 21 16 0 5+ Markdown 2 42 42 0 0+ TOML 3 87 78 0 9+ YAML 1 9 9 0 0+-------------------------------------------------------------------------------+ Total 11 257 226 5 26+------------------------------------------------------------------------------- ```
app/Main.hs view
@@ -1,6 +1,6 @@ module Main where -import Lib (exec)+import Toml.Checker (exec) main :: IO () main = exec
− src/Lib.hs
@@ -1,32 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TypeOperators #-}--module Lib- ( exec- ) where--import qualified Data.Text.IO as TIO-import GHC.Generics (Generic)-import Options.Generic-import Text.Megaparsec (parseErrorPretty)-import Text.Toml (parseTomlDoc)--newtype Program = Program { file :: FilePath <?> "Path to file to be checked." }- deriving (Generic)--programModifiers :: Modifiers-programModifiers = defaultModifiers { shortNameModifier = firstLetter }--instance ParseRecord Program where- parseRecord = parseRecordWithModifiers programModifiers--exec :: IO ()-exec = do- x <- getRecord "Command-line wrapper around htoml"- let path = unHelpful $ file x- contents <- TIO.readFile path- case parseTomlDoc path contents of- Right{} -> pure ()- Left e -> putStrLn $ parseErrorPretty e
+ src/Toml/Checker.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeOperators #-}++module Toml.Checker+ ( exec+ ) where++import qualified Data.Text.IO as TIO+import GHC.Generics (Generic)+import Options.Generic+import Text.Megaparsec (parseErrorPretty)+import Text.Toml (parseTomlDoc)++newtype Program = Program { file :: FilePath <?> "Path to file to be checked." }+ deriving (Generic)++programModifiers :: Modifiers+programModifiers = defaultModifiers { shortNameModifier = firstLetter }++instance ParseRecord Program where+ parseRecord = parseRecordWithModifiers programModifiers++exec :: IO ()+exec = do+ x <- getRecord "Command-line wrapper around htoml"+ let path = unHelpful $ file x+ contents <- TIO.readFile path+ case parseTomlDoc path contents of+ Right{} -> pure ()+ Left e -> putStrLn $ parseErrorPretty e
stack.yaml view
@@ -3,7 +3,7 @@ - './' extra-deps: - megaparsec-6.2.0- - htoml-megaparsec-1.0.1.0+ - htoml-megaparsec-1.0.1.1 - composition-prelude-0.1.1.0 flags: {} extra-package-dbs: []
tomlcheck.cabal view
@@ -1,5 +1,5 @@ name: tomlcheck-version: 0.1.0.0+version: 0.1.0.1 synopsis: Command-line tool to check syntax of TOML files description: This is a command-line wrapper around htoml-megaparsec. It is intended to be used as a syntax checker that can be@@ -16,6 +16,7 @@ , stack.yaml cabal-version: >=1.18 Data-files: .travis.yml+ , Justfile Extra-doc-files: README.md Flag development {@@ -26,9 +27,9 @@ library hs-source-dirs: src- exposed-modules: Lib+ exposed-modules: Toml.Checker build-depends: base >= 4.8 && < 5- , htoml-megaparsec >= 1.0.1.0+ , htoml-megaparsec >= 1.0.1.1 , optparse-generic , megaparsec >= 6.0 , text