Skip to content

Commit 9b17898

Browse files
authored
Merge pull request #44 from serokell/hackage
Prepare for hackage release
2 parents 8846806 + 708efb4 commit 9b17898

File tree

5 files changed

+38
-27
lines changed

5 files changed

+38
-27
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
# Revision history for nixfmt
99

10+
## 0.3.0 -- 2019-08-29
11+
12+
* Added check flag for use in CI.
13+
* Added quiet flag to disable all output on stderr.
14+
* Further improved indentation.
15+
* Fixed bugs where Nix code with different semantics was emitted in some cases.
16+
1017
## 0.2.1 -- 2019-07-29
1118

1219
* Fixed missing linebreaks in set abstractions.

Setup.hs

Lines changed: 0 additions & 8 deletions
This file was deleted.

nixfmt.cabal

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
cabal-version: >=1.10
1+
cabal-version: 2.0
22

33
-- © 2019 Serokell <hi@serokell.io>
44
-- © 2019 Lars Jellema <lars.jellema@gmail.com>
55
--
66
-- SPDX-License-Identifier: MPL-2.0
77

88
name: nixfmt
9-
version: 0.2.1
9+
version: 0.3.0
1010
synopsis: An opinionated formatter for Nix
11-
-- description:
11+
description:
12+
A formatter for Nix that ensures consistent and clear formatting by forgetting
13+
all existing formatting during parsing.
1214
homepage: https://github.com/serokell/nixfmt
13-
-- bug-reports:
15+
bug-reports: https://github.com/serokell/nixfmt/issues
1416
license: MPL-2.0
1517
license-file: LICENSE
1618
author: Lars Jellema
@@ -20,6 +22,10 @@ category: Development
2022
build-type: Simple
2123
extra-source-files: README.md, CHANGELOG.md
2224

25+
source-repository head
26+
type: git
27+
location: git://github.com/serokell/nixfmt.git
28+
2329
executable nixfmt
2430
main-is: Main.hs
2531
other-modules:
@@ -32,17 +38,16 @@ executable nixfmt
3238
else
3339
buildable: True
3440
build-depends:
35-
base
36-
, cmdargs
41+
base >= 4.12.0 && < 4.13
42+
, cmdargs >= 0.10.20 && < 0.11
3743
, nixfmt
38-
, unix
39-
, text
44+
, unix >= 2.7.2 && < 2.8
45+
, text >= 1.2.3 && < 1.3
4046

4147
-- for System.IO.Atomic
42-
, directory
43-
, filepath
44-
, safe-exceptions
45-
, unix
48+
, directory >= 1.3.3 && < 1.4
49+
, filepath >= 1.4.2 && < 1.5
50+
, safe-exceptions >= 0.1.7 && < 0.2
4651
default-language: Haskell2010
4752
ghc-options:
4853
-Wall
@@ -64,10 +69,10 @@ library
6469
other-extensions: OverloadedStrings, LambdaCase, FlexibleInstances, DeriveFoldable, DeriveFunctor, StandaloneDeriving
6570
hs-source-dirs: src
6671
build-depends:
67-
base
68-
, megaparsec >= 7
69-
, parser-combinators
70-
, text
72+
base >= 4.12.0 && < 4.13
73+
, megaparsec >= 7.0.5 && < 7.1
74+
, parser-combinators >= 1.0.3 && < 1.3
75+
, text >= 1.2.3 && < 1.3
7176
default-language: Haskell2010
7277
ghc-options:
7378
-Wall
@@ -89,9 +94,10 @@ executable js-interface
8994
-Wincomplete-uni-patterns
9095
-Wredundant-constraints
9196
-Wno-orphans
92-
build-depends: base,
93-
ghcjs-base,
94-
nixfmt
97+
build-depends:
98+
base >= 4.12.0 && < 4.13
99+
, ghcjs-base >= 0.2.0 && < 0.3
100+
, nixfmt
95101
js-sources: js/js-interface-wrapper.js
96102
hs-source-dirs: js/
97103
else

src/Nixfmt.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@ import Nixfmt.Predoc (layout)
1919
import Nixfmt.Pretty ()
2020
import Nixfmt.Types (ParseErrorBundle)
2121

22+
-- | @format w filename source@ returns either a parsing error specifying a
23+
-- failure in @filename@ or a formatted version of @source@ with a maximum width
24+
-- of @w@ columns where possible.
2225
format :: Int -> FilePath -> Text -> Either ParseErrorBundle Text
2326
format width filename = fmap (layout width) . parse file filename

src/Nixfmt/Types.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import Data.Text (Text, pack)
1414
import Data.Void (Void)
1515
import qualified Text.Megaparsec as MP (ParseErrorBundle, Parsec)
1616

17+
-- | A @megaparsec@ @ParsecT@ specified for use with @nixfmt@.
1718
type Parser = MP.Parsec Void Text
19+
20+
-- | A @megaparsec@ @ParseErrorBundle@ specified for use with @nixfmt@.
1821
type ParseErrorBundle = MP.ParseErrorBundle Text Void
1922

2023
data Trivium

0 commit comments

Comments
 (0)