Skip to content

Commit

Permalink
Merge pull request #44 from serokell/hackage
Browse files Browse the repository at this point in the history
Prepare for hackage release
  • Loading branch information
yorickvP authored Aug 29, 2019
2 parents 8846806 + 708efb4 commit 9b17898
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

# Revision history for nixfmt

## 0.3.0 -- 2019-08-29

* Added check flag for use in CI.
* Added quiet flag to disable all output on stderr.
* Further improved indentation.
* Fixed bugs where Nix code with different semantics was emitted in some cases.

## 0.2.1 -- 2019-07-29

* Fixed missing linebreaks in set abstractions.
Expand Down
8 changes: 0 additions & 8 deletions Setup.hs

This file was deleted.

44 changes: 25 additions & 19 deletions nixfmt.cabal
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
cabal-version: >=1.10
cabal-version: 2.0

-- © 2019 Serokell <[email protected]>
-- © 2019 Lars Jellema <[email protected]>
--
-- SPDX-License-Identifier: MPL-2.0

name: nixfmt
version: 0.2.1
version: 0.3.0
synopsis: An opinionated formatter for Nix
-- description:
description:
A formatter for Nix that ensures consistent and clear formatting by forgetting
all existing formatting during parsing.
homepage: https://github.com/serokell/nixfmt
-- bug-reports:
bug-reports: https://github.com/serokell/nixfmt/issues
license: MPL-2.0
license-file: LICENSE
author: Lars Jellema
Expand All @@ -20,6 +22,10 @@ category: Development
build-type: Simple
extra-source-files: README.md, CHANGELOG.md

source-repository head
type: git
location: git://github.com/serokell/nixfmt.git

executable nixfmt
main-is: Main.hs
other-modules:
Expand All @@ -32,17 +38,16 @@ executable nixfmt
else
buildable: True
build-depends:
base
, cmdargs
base >= 4.12.0 && < 4.13
, cmdargs >= 0.10.20 && < 0.11
, nixfmt
, unix
, text
, unix >= 2.7.2 && < 2.8
, text >= 1.2.3 && < 1.3

-- for System.IO.Atomic
, directory
, filepath
, safe-exceptions
, unix
, directory >= 1.3.3 && < 1.4
, filepath >= 1.4.2 && < 1.5
, safe-exceptions >= 0.1.7 && < 0.2
default-language: Haskell2010
ghc-options:
-Wall
Expand All @@ -64,10 +69,10 @@ library
other-extensions: OverloadedStrings, LambdaCase, FlexibleInstances, DeriveFoldable, DeriveFunctor, StandaloneDeriving
hs-source-dirs: src
build-depends:
base
, megaparsec >= 7
, parser-combinators
, text
base >= 4.12.0 && < 4.13
, megaparsec >= 7.0.5 && < 7.1
, parser-combinators >= 1.0.3 && < 1.3
, text >= 1.2.3 && < 1.3
default-language: Haskell2010
ghc-options:
-Wall
Expand All @@ -89,9 +94,10 @@ executable js-interface
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wno-orphans
build-depends: base,
ghcjs-base,
nixfmt
build-depends:
base >= 4.12.0 && < 4.13
, ghcjs-base >= 0.2.0 && < 0.3
, nixfmt
js-sources: js/js-interface-wrapper.js
hs-source-dirs: js/
else
Expand Down
3 changes: 3 additions & 0 deletions src/Nixfmt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ import Nixfmt.Predoc (layout)
import Nixfmt.Pretty ()
import Nixfmt.Types (ParseErrorBundle)

-- | @format w filename source@ returns either a parsing error specifying a
-- failure in @filename@ or a formatted version of @source@ with a maximum width
-- of @w@ columns where possible.
format :: Int -> FilePath -> Text -> Either ParseErrorBundle Text
format width filename = fmap (layout width) . parse file filename
3 changes: 3 additions & 0 deletions src/Nixfmt/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import Data.Text (Text, pack)
import Data.Void (Void)
import qualified Text.Megaparsec as MP (ParseErrorBundle, Parsec)

-- | A @megaparsec@ @ParsecT@ specified for use with @nixfmt@.
type Parser = MP.Parsec Void Text

-- | A @megaparsec@ @ParseErrorBundle@ specified for use with @nixfmt@.
type ParseErrorBundle = MP.ParseErrorBundle Text Void

data Trivium
Expand Down

0 comments on commit 9b17898

Please sign in to comment.