diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b3ca67..43f9f20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,8 @@ jobs: - name: Set up PureScript toolchain uses: purescript-contrib/setup-purescript@main + with: + purs-tidy: "latest" - name: Cache PureScript dependencies uses: actions/cache@v2 @@ -25,9 +27,9 @@ jobs: output - name: Set up Node toolchain - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: "12.x" + node-version: "14.x" - name: Cache NPM dependencies uses: actions/cache@v2 @@ -49,3 +51,6 @@ jobs: - name: Run tests run: npm run test + + - name: Check formatting + run: purs-tidy check src test diff --git a/.gitignore b/.gitignore index 5a54e2f..6a45203 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ !.gitignore !.github !.editorconfig +!.tidyrc.json !.eslintrc.json output diff --git a/.tidyrc.json b/.tidyrc.json new file mode 100644 index 0000000..4f013c1 --- /dev/null +++ b/.tidyrc.json @@ -0,0 +1,10 @@ +{ + "importSort": "source", + "importWrap": "source", + "indent": 2, + "operatorsFile": null, + "ribbon": 1, + "typeArrowPlacement": "first", + "unicode": "never", + "width": null +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0fcc8..a5a43ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ New features: Bugfixes: Other improvements: +- Added `purs-tidy` formatter (#17 by @thomashoneyman) ## [v4.0.0](https://github.com/purescript-contrib/purescript-unsafe-reference/releases/tag/v4.0.0) - 2021-02-26 diff --git a/src/Unsafe/Reference.purs b/src/Unsafe/Reference.purs index d78d818..24ab064 100644 --- a/src/Unsafe/Reference.purs +++ b/src/Unsafe/Reference.purs @@ -1,8 +1,8 @@ module Unsafe.Reference ( unsafeRefEq , reallyUnsafeRefEq - , UnsafeRefEq (..) - , UnsafeRefEqFallback (..) + , UnsafeRefEq(..) + , UnsafeRefEqFallback(..) ) where import Prelude @@ -27,6 +27,6 @@ newtype UnsafeRefEqFallback a = UnsafeRefEqFallback a instance eqUnsafeRefEqFallback :: Eq a => Eq (UnsafeRefEqFallback a) where - eq (UnsafeRefEqFallback l) (UnsafeRefEqFallback r) = - unsafeRefEq l r || l == r + eq (UnsafeRefEqFallback l) (UnsafeRefEqFallback r) = + unsafeRefEq l r || l == r diff --git a/test/Main.purs b/test/Main.purs index 075b980..7a81596 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -24,11 +24,11 @@ derive instance eqX :: Eq X main :: Effect Unit main = do let - foo1 = Foo "foo" - foo2 = Foo "foo" + foo1 = Foo "foo" + foo2 = Foo "foo" foo3 = Foo' "foo" foo4 = Foo' "foo" - bar1 = Bar "foo" + bar1 = Bar "foo" bar2 = Bar' "foo" assert (unsafeRefEq foo1 foo1) "unsafeRefEq data"