diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-01-12 09:42:50 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-01-12 09:42:50 -0700 |
commit | ee8fe1fbeb3e1a9b5488f81d1ff799b158810435 (patch) | |
tree | f81bfd76449b4e6913072f622dd6809568c6a3e0 | |
parent | d607e0eac23654729ba3e262e8a31129e2473b0b (diff) | |
parent | dc526034228e8431731645fcb483386931cae199 (diff) | |
download | stylish-haskell-ee8fe1fbeb3e1a9b5488f81d1ff799b158810435.tar.gz |
Merge tag 'v0.9.2.1'
v0.9.2.1
-rw-r--r-- | .circleci/config.yml | 18 | ||||
-rw-r--r-- | CHANGELOG | 5 | ||||
-rw-r--r-- | README.markdown | 17 | ||||
-rw-r--r-- | lib/Language/Haskell/Stylish/Config.hs | 7 | ||||
-rwxr-xr-x | scripts/latest.sh | 2 | ||||
-rw-r--r-- | stack.yaml | 4 | ||||
-rw-r--r-- | stylish-haskell.cabal | 20 |
7 files changed, 44 insertions, 29 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 3845c0e..e6a538c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,21 +17,15 @@ jobs: steps: - checkout - restore_cache: - key: 'v1-stylish-haskell-{{ arch }}-{{ .Branch }}' + key: 'v2-stylish-haskell-{{ arch }}-{{ .Branch }}' - run: - name: 'Update cabal indices' - command: 'cabal update' - - run: - name: 'Build and install' - command: 'cabal install --enable-tests --jobs=1' - - run: - name: 'Run tests' - command: 'cabal test' + name: 'Build, install and test' + command: 'stack build --test --copy-bins --jobs=1' - save_cache: - key: 'v1-stylish-haskell-{{ arch }}-{{ .Branch }}-{{ .Revision }}' + key: 'v2-stylish-haskell-{{ arch }}-{{ .Branch }}-{{ .Revision }}' paths: - - '~/.cabal' - - '~/.ghc' + - '~/.stack-work' + - '~/.stack' - run: name: 'Upload release' command: '.circleci/release.sh "$CIRCLE_TAG"' @@ -1,5 +1,10 @@ # CHANGELOG +- 0.9.2.1 (2019-01-02) + * Bump `aeson` to 1.4 + * Bump `yaml` to 0.11 + * Bump `containers` to 0.6 + - 0.9.2.0 (2018-05-01) * Support alignment of case expressions with a single guard * Add a new step to squash multiple spaces between some elements (by Martin diff --git a/README.markdown b/README.markdown index 88df2b7..a3406c6 100644 --- a/README.markdown +++ b/README.markdown @@ -112,6 +112,16 @@ Or you can define `formatprg` and then use `gq`. +Alternatively, [vim-autoformat] supports stylish-haskell. To have it automatically reformat the files on save, add to your vimrc: + +```vim +autocmd BufWrite *.hs :Autoformat +" Don't automatically indent on save, since vim's autoindent for haskell is buggy +autocmd FileType haskell let b:autoformat_autoindent=0 +``` + +[vim-autoformat]: https://github.com/Chiel92/vim-autoformat + There is also the [vim-stylish-haskell] plugin, which runs stylish-haskell automatically when you save a Haskell file. @@ -137,6 +147,13 @@ Atom integration [ide-haskell]: https://atom.io/packages/ide-haskell [atom-beautify]: Https://atom.io/packages/atom-beautify +Visual Studio Code integration +------------------------------ + +[stylish-haskell-vscode] for VSCode supports `stylish-haskell`. + +[stylish-haskell-vscode]: https://github.com/vigoo/stylish-haskell-vscode + Using with Continuous Integration --------------------------------- diff --git a/lib/Language/Haskell/Stylish/Config.hs b/lib/Language/Haskell/Stylish/Config.hs index 19588b7..ad30498 100644 --- a/lib/Language/Haskell/Stylish/Config.hs +++ b/lib/Language/Haskell/Stylish/Config.hs @@ -22,7 +22,8 @@ import Data.List (inits, import Data.Map (Map) import qualified Data.Map as M import Data.Maybe (fromMaybe) -import Data.Yaml (decodeEither) +import Data.Yaml (decodeEither', + prettyPrintParseException) import System.Directory import System.FilePath (joinPath, splitPath, @@ -103,9 +104,9 @@ loadConfig verbose userSpecified = do mbFp <- configFilePath verbose userSpecified verbose $ "Loading configuration at " ++ fromMaybe "<embedded>" mbFp bytes <- maybe (return defaultConfigBytes) B.readFile mbFp - case decodeEither bytes of + case decodeEither' bytes of Left err -> error $ - "Language.Haskell.Stylish.Config.loadConfig: " ++ err + "Language.Haskell.Stylish.Config.loadConfig: " ++ prettyPrintParseException err Right config -> return config diff --git a/scripts/latest.sh b/scripts/latest.sh index dc5c345..b3e3760 100755 --- a/scripts/latest.sh +++ b/scripts/latest.sh @@ -8,7 +8,7 @@ echo Downloading and running $PACKAGE... RELEASES=$(curl --silent https://github.com/jaspervdj/$PACKAGE/releases) URL=https://github.com/$(echo $RELEASES | grep -o '\"[^\"]*-linux-x86_64\.tar\.gz\"' | sed s/\"//g | head -n1) -VERSION=$(echo $URL | sed -e 's/.*-\([\.0-9]\+\)-linux-x86_64\.tar\.gz/\1/') +VERSION=$(echo $URL | sed -e 's/.*-\(v[\.0-9]\+-linux-x86_64\)\.tar\.gz/\1/') TEMP=$(mktemp --directory .$PACKAGE-XXXXX) cleanup(){ @@ -1,6 +1,4 @@ flags: {} packages: - '.' -resolver: lts-11.5 -extra-deps: -- 'aeson-1.3.1.0' +resolver: lts-13.0 diff --git a/stylish-haskell.cabal b/stylish-haskell.cabal index 31f9e23..a72698d 100644 --- a/stylish-haskell.cabal +++ b/stylish-haskell.cabal @@ -1,5 +1,5 @@ Name: stylish-haskell -Version: 0.9.2.0 +Version: 0.9.2.1 Synopsis: Haskell code prettifier Homepage: https://github.com/jaspervdj/stylish-haskell License: BSD3 @@ -49,10 +49,10 @@ Library Paths_stylish_haskell Build-depends: - aeson >= 0.6 && < 1.4, + aeson >= 0.6 && < 1.5, base >= 4.8 && < 5, bytestring >= 0.9 && < 0.11, - containers >= 0.3 && < 0.6, + containers >= 0.3 && < 0.7, directory >= 1.2.3 && < 1.4, filepath >= 1.1 && < 1.5, file-embed >= 0.0.10 && < 0.1, @@ -60,7 +60,7 @@ Library mtl >= 2.0 && < 2.3, semigroups >= 0.18 && < 0.19, syb >= 0.3 && < 0.8, - yaml >= 0.7 && < 0.9 + yaml >= 0.8.11 && < 0.12 Executable stylish-haskell Ghc-options: -Wall @@ -72,17 +72,17 @@ Executable stylish-haskell strict >= 0.3 && < 0.4, optparse-applicative >= 0.12 && < 0.15, -- Copied from regular dependencies... - aeson >= 0.6 && < 1.4, + aeson >= 0.6 && < 1.5, base >= 4.8 && < 5, bytestring >= 0.9 && < 0.11, - containers >= 0.3 && < 0.6, + containers >= 0.3 && < 0.7, directory >= 1.2.3 && < 1.4, filepath >= 1.1 && < 1.5, file-embed >= 0.0.10 && < 0.1, haskell-src-exts >= 1.18 && < 1.21, mtl >= 2.0 && < 2.3, syb >= 0.3 && < 0.8, - yaml >= 0.7 && < 0.9 + yaml >= 0.8.11 && < 0.12 Test-suite stylish-haskell-tests Ghc-options: -Wall @@ -121,17 +121,17 @@ Test-suite stylish-haskell-tests test-framework >= 0.4 && < 0.9, test-framework-hunit >= 0.2 && < 0.4, -- Copied from regular dependencies... - aeson >= 0.6 && < 1.4, + aeson >= 0.6 && < 1.5, base >= 4.8 && < 5, bytestring >= 0.9 && < 0.11, - containers >= 0.3 && < 0.6, + containers >= 0.3 && < 0.7, directory >= 1.2.3 && < 1.4, filepath >= 1.1 && < 1.5, file-embed >= 0.0.10 && < 0.1, haskell-src-exts >= 1.18 && < 1.21, mtl >= 2.0 && < 2.3, syb >= 0.3 && < 0.8, - yaml >= 0.7 && < 0.9 + yaml >= 0.8.11 && < 0.12 Source-repository head Type: git |