Skip to content

Commit b341f8d

Browse files
Introduce purs-tidy formatter (#57)
* Add purs-tidy formatter * Run purs-tidy
1 parent 8fd26a1 commit b341f8d

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
- name: Set up a PureScript toolchain
1717
uses: purescript-contrib/setup-purescript@main
18+
with:
19+
purs-tidy: "latest"
1820

1921
- name: Cache PureScript dependencies
2022
uses: actions/cache@v2
@@ -32,3 +34,6 @@ jobs:
3234

3335
- name: Run tests
3436
run: spago test --no-install
37+
38+
- name: Check formatting
39+
run: purs-tidy check src test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
!.gitignore
33
!.github
44
!.editorconfig
5+
!.tidyrc.json
56

67
output
78
generated-docs

.tidyrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"importSort": "source",
3+
"importWrap": "source",
4+
"indent": 2,
5+
"operatorsFile": null,
6+
"ribbon": 1,
7+
"typeArrowPlacement": "first",
8+
"unicode": "never",
9+
"width": null
10+
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ New features:
1111
Bugfixes:
1212

1313
Other improvements:
14+
- Added `purs-tidy` formatter (#6 by @thomashoneyman)
1415

1516
## [v8.0.0](https://github.com/purescript-contrib/purescript-argonaut/releases/tag/v8.0.0) - 2021-02-26
1617

src/Data/Argonaut.purs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module Data.Argonaut
88
, module Data.Argonaut.Traversals
99
) where
1010

11-
1211
import Data.Argonaut.Core (Json, caseJson, caseJsonArray, caseJsonBoolean, caseJsonNull, caseJsonNumber, caseJsonObject, caseJsonString, fromArray, fromBoolean, fromNumber, fromObject, fromString, isArray, isBoolean, isNull, isNumber, isObject, isString, jsonEmptyArray, jsonEmptyObject, jsonEmptyString, jsonFalse, jsonNull, jsonSingletonArray, jsonSingletonObject, jsonTrue, jsonZero, stringify, stringifyWithIndent, toArray, toBoolean, toNull, toNumber, toObject, toString)
1312
import Data.Argonaut.Decode (class DecodeJson, JsonDecodeError(..), decodeJson, defaultField, getField, getFieldOptional, getFieldOptional', parseJson, printJsonDecodeError, (.!=), (.:), (.:!), (.:?))
1413
import Data.Argonaut.Encode (class EncodeJson, assoc, assocOptional, encodeJson, extend, extendOptional, (:=), (:=?), (~>), (~>?))

test/Test/Main.purs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ prop_toPrims_fromPrims = do
2424

2525
genTestJCursor :: Gen JCursor
2626
genTestJCursor = do
27-
i <- chooseInt 0 2
28-
r <- if i == 0 then pure JCursorTop
29-
else if i == 1 then JField <$> genUnicodeString <*> genTestJCursor
30-
else JIndex <$> chooseInt bottom top <*> genTestJCursor
31-
pure r
27+
i <- chooseInt 0 2
28+
r <-
29+
if i == 0 then pure JCursorTop
30+
else if i == 1 then JField <$> genUnicodeString <*> genTestJCursor
31+
else JIndex <$> chooseInt bottom top <*> genTestJCursor
32+
pure r
3233

3334
prop_jcursor_serialization :: Gen Result
3435
prop_jcursor_serialization = do

0 commit comments

Comments
 (0)