mirror of
https://github.com/natefaubion/purescript-tidy.git
synced 2024-11-26 00:09:27 +03:00
Update for 0.15 syntax and libs (#94)
* Update for 0.15 syntax and libs * Use 0.14 in CI
This commit is contained in:
parent
9e18cef330
commit
728f08b602
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -12,6 +12,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: purescript-contrib/setup-purescript@main
|
- uses: purescript-contrib/setup-purescript@main
|
||||||
|
with:
|
||||||
|
purescript: "0.14.7"
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
# This cache uses the .dhall files to know when it should reinstall
|
# This cache uses the .dhall files to know when it should reinstall
|
||||||
# and rebuild packages. It caches both the installed packages from
|
# and rebuild packages. It caches both the installed packages from
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
, "parallel"
|
, "parallel"
|
||||||
, "partial"
|
, "partial"
|
||||||
, "prelude"
|
, "prelude"
|
||||||
, "psci-support"
|
|
||||||
, "purescript-language-cst-parser"
|
, "purescript-language-cst-parser"
|
||||||
, "refs"
|
, "refs"
|
||||||
, "strings"
|
, "strings"
|
||||||
|
@ -23,7 +23,7 @@ let additions =
|
|||||||
]
|
]
|
||||||
, repo =
|
, repo =
|
||||||
"https://github.com/natefaubion/purescript-language-cst-parser.git"
|
"https://github.com/natefaubion/purescript-language-cst-parser.git"
|
||||||
, version = "v0.10.1"
|
, version = "v0.11.0"
|
||||||
}
|
}
|
||||||
, dodo-printer =
|
, dodo-printer =
|
||||||
{ dependencies =
|
{ dependencies =
|
||||||
|
@ -30,7 +30,8 @@ main = do
|
|||||||
let genCmd = Path.concat [ cwdPath, "bin", "index.js" ] <> " generate-operators '.spago/*/*/src/**/*.purs'"
|
let genCmd = Path.concat [ cwdPath, "bin", "index.js" ] <> " generate-operators '.spago/*/*/src/**/*.purs'"
|
||||||
|
|
||||||
writeTextFile UTF8 (Path.concat [ tmpPath, "spago.dhall" ]) defaultSpagoDhall
|
writeTextFile UTF8 (Path.concat [ tmpPath, "spago.dhall" ]) defaultSpagoDhall
|
||||||
_ <- ChildProcess.execSync "spago install" opts
|
writeTextFile UTF8 (Path.concat [ tmpPath, "package.json" ]) defaultPackageJson
|
||||||
|
_ <- ChildProcess.execSync "npm install" opts
|
||||||
output <- Buffer.toString UTF8 =<< catchException
|
output <- Buffer.toString UTF8 =<< catchException
|
||||||
( \err -> do
|
( \err -> do
|
||||||
stdout <- Buffer.toString UTF8 ((unsafeCoerce err).stdout :: Buffer)
|
stdout <- Buffer.toString UTF8 ((unsafeCoerce err).stdout :: Buffer)
|
||||||
@ -68,6 +69,21 @@ main = do
|
|||||||
|
|
||||||
writeTextFile UTF8 (Path.concat [ cwdPath, "src", "Tidy", "Operators", "Defaults.purs" ]) contents
|
writeTextFile UTF8 (Path.concat [ cwdPath, "src", "Tidy", "Operators", "Defaults.purs" ]) contents
|
||||||
|
|
||||||
|
defaultPackageJson :: String
|
||||||
|
defaultPackageJson =
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"purescript": "^0.15.0",
|
||||||
|
"spago": "^0.20.8"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "spago install"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
defaultSpagoDhall :: String
|
defaultSpagoDhall :: String
|
||||||
defaultSpagoDhall =
|
defaultSpagoDhall =
|
||||||
"""
|
"""
|
||||||
@ -128,7 +144,6 @@ defaultSpagoDhall =
|
|||||||
, "lcg"
|
, "lcg"
|
||||||
, "lists"
|
, "lists"
|
||||||
, "machines"
|
, "machines"
|
||||||
, "math"
|
|
||||||
, "matryoshka"
|
, "matryoshka"
|
||||||
, "maybe"
|
, "maybe"
|
||||||
, "media-types"
|
, "media-types"
|
||||||
@ -177,7 +192,7 @@ defaultSpagoDhall =
|
|||||||
, "uri"
|
, "uri"
|
||||||
, "validation"
|
, "validation"
|
||||||
]
|
]
|
||||||
, packages = https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210811/packages.dhall sha256:a2de7ef2f2e753733eddfa90573a82da0c7c61d46fa87d015b7f15ef8a6e97d5
|
, packages = https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220429/packages.dhall
|
||||||
, sources = [] : List Text
|
, sources = [] : List Text
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
@ -269,8 +269,6 @@ formatExport conf = case _ of
|
|||||||
formatToken conf t `space` anchor (formatName conf n)
|
formatToken conf t `space` anchor (formatName conf n)
|
||||||
ExportClass t n ->
|
ExportClass t n ->
|
||||||
formatToken conf t `space` anchor (formatName conf n)
|
formatToken conf t `space` anchor (formatName conf n)
|
||||||
ExportKind t n ->
|
|
||||||
formatToken conf t `space` anchor (formatName conf n)
|
|
||||||
ExportModule t n ->
|
ExportModule t n ->
|
||||||
formatToken conf t `space` anchor (formatName conf n)
|
formatToken conf t `space` anchor (formatName conf n)
|
||||||
ExportError e ->
|
ExportError e ->
|
||||||
@ -342,8 +340,6 @@ sortImportsIde (Wrapped { open, value: Separated { head, tail }, close }) = do
|
|||||||
ImportTypeOpCmp name
|
ImportTypeOpCmp name
|
||||||
ImportClass _ (Name { name }) ->
|
ImportClass _ (Name { name }) ->
|
||||||
ImportClassCmp name
|
ImportClassCmp name
|
||||||
ImportKind _ (Name { name }) ->
|
|
||||||
ImportTypeCmp name true []
|
|
||||||
ImportError _ ->
|
ImportError _ ->
|
||||||
ImportErrorCmp
|
ImportErrorCmp
|
||||||
|
|
||||||
@ -370,8 +366,6 @@ formatImport conf = case _ of
|
|||||||
formatToken conf t `space` anchor (formatName conf n)
|
formatToken conf t `space` anchor (formatName conf n)
|
||||||
ImportClass t n ->
|
ImportClass t n ->
|
||||||
formatToken conf t `space` anchor (formatName conf n)
|
formatToken conf t `space` anchor (formatName conf n)
|
||||||
ImportKind t n ->
|
|
||||||
formatToken conf t `space` anchor (formatName conf n)
|
|
||||||
ImportError e ->
|
ImportError e ->
|
||||||
conf.formatError e
|
conf.formatError e
|
||||||
|
|
||||||
@ -688,6 +682,8 @@ formatHangingMonotype conf = case _ of
|
|||||||
hangBreak $ formatName conf n
|
hangBreak $ formatName conf n
|
||||||
TypeString t _ ->
|
TypeString t _ ->
|
||||||
hangBreak $ formatToken conf t
|
hangBreak $ formatToken conf t
|
||||||
|
TypeInt t _ ->
|
||||||
|
hangBreak $ formatToken conf t
|
||||||
TypeArrowName t ->
|
TypeArrowName t ->
|
||||||
hangBreak $ formatToken conf t
|
hangBreak $ formatToken conf t
|
||||||
TypeOpName n ->
|
TypeOpName n ->
|
||||||
@ -701,8 +697,6 @@ formatHangingMonotype conf = case _ of
|
|||||||
`hangApp` map (formatHangingType conf) tail
|
`hangApp` map (formatHangingType conf) tail
|
||||||
TypeParens ty ->
|
TypeParens ty ->
|
||||||
hangBreak $ formatParensBlock formatType conf ty
|
hangBreak $ formatParensBlock formatType conf ty
|
||||||
TypeUnaryRow t ty ->
|
|
||||||
hangBreak $ formatToken conf t `space` formatType conf ty
|
|
||||||
TypeKinded ty1 t ty2 ->
|
TypeKinded ty1 t ty2 ->
|
||||||
hangBreak $ formatType conf ty1 `space` indent do
|
hangBreak $ formatType conf ty1 `space` indent do
|
||||||
anchor (formatToken conf t)
|
anchor (formatToken conf t)
|
||||||
|
@ -104,19 +104,6 @@ defaultOperators =
|
|||||||
, """Control.MonadPlus.(=<<) 1"""
|
, """Control.MonadPlus.(=<<) 1"""
|
||||||
, """Control.MonadPlus.(>=>) 1"""
|
, """Control.MonadPlus.(>=>) 1"""
|
||||||
, """Control.MonadPlus.(>>=) 1"""
|
, """Control.MonadPlus.(>>=) 1"""
|
||||||
, """Control.MonadZero.($>) 4"""
|
|
||||||
, """Control.MonadZero.(*>) 4"""
|
|
||||||
, """Control.MonadZero.(<#>) 1"""
|
|
||||||
, """Control.MonadZero.(<$) 4"""
|
|
||||||
, """Control.MonadZero.(<$>) 4"""
|
|
||||||
, """Control.MonadZero.(<*) 4"""
|
|
||||||
, """Control.MonadZero.(<*>) 4"""
|
|
||||||
, """Control.MonadZero.(<=<) 1"""
|
|
||||||
, """Control.MonadZero.(<@>) 4"""
|
|
||||||
, """Control.MonadZero.(<|>) 3"""
|
|
||||||
, """Control.MonadZero.(=<<) 1"""
|
|
||||||
, """Control.MonadZero.(>=>) 1"""
|
|
||||||
, """Control.MonadZero.(>>=) 1"""
|
|
||||||
, """Control.Plus.($>) 4"""
|
, """Control.Plus.($>) 4"""
|
||||||
, """Control.Plus.(<#>) 1"""
|
, """Control.Plus.(<#>) 1"""
|
||||||
, """Control.Plus.(<$) 4"""
|
, """Control.Plus.(<$) 4"""
|
||||||
@ -278,6 +265,7 @@ defaultOperators =
|
|||||||
, """Data.Monoid.(<>) 5"""
|
, """Data.Monoid.(<>) 5"""
|
||||||
, """Data.NaturalTransformation.(~>) type 4"""
|
, """Data.NaturalTransformation.(~>) type 4"""
|
||||||
, """Data.NonEmpty.(:|) 5"""
|
, """Data.NonEmpty.(:|) 5"""
|
||||||
|
, """Data.Number.(%) 7"""
|
||||||
, """Data.Number.Approximate.(~=) 4"""
|
, """Data.Number.Approximate.(~=) 4"""
|
||||||
, """Data.Number.Approximate.(≅) 4"""
|
, """Data.Number.Approximate.(≅) 4"""
|
||||||
, """Data.Number.Approximate.(≇) 4"""
|
, """Data.Number.Approximate.(≇) 4"""
|
||||||
@ -299,7 +287,23 @@ defaultOperators =
|
|||||||
, """Data.Tuple.Nested.(/\) type 6"""
|
, """Data.Tuple.Nested.(/\) type 6"""
|
||||||
, """Data.Tuple.Nested.(/\) 6"""
|
, """Data.Tuple.Nested.(/\) 6"""
|
||||||
, """Foreign.Index.(!) 9"""
|
, """Foreign.Index.(!) 9"""
|
||||||
, """Math.(%) 7"""
|
, """Parsing.Combinators.(!!) 8"""
|
||||||
|
, """Parsing.Combinators.($>) 4"""
|
||||||
|
, """Parsing.Combinators.(..) 8"""
|
||||||
|
, """Parsing.Combinators.(:) 6"""
|
||||||
|
, """Parsing.Combinators.(<#>) 1"""
|
||||||
|
, """Parsing.Combinators.(<$) 4"""
|
||||||
|
, """Parsing.Combinators.(<$>) 4"""
|
||||||
|
, """Parsing.Combinators.(<?>) 4"""
|
||||||
|
, """Parsing.Combinators.(<??>) 3"""
|
||||||
|
, """Parsing.Combinators.(<@>) 4"""
|
||||||
|
, """Parsing.Combinators.(<|>) 3"""
|
||||||
|
, """Parsing.Combinators.(<~?>) 4"""
|
||||||
|
, """Parsing.Combinators.(\\) 5"""
|
||||||
|
, """Parsing.Indent.(<*/>) 11"""
|
||||||
|
, """Parsing.Indent.(<+/>) 9"""
|
||||||
|
, """Parsing.Indent.(<-/>) 10"""
|
||||||
|
, """Parsing.Indent.(<?/>) 12"""
|
||||||
, """Pathy.(<..>) 6"""
|
, """Pathy.(<..>) 6"""
|
||||||
, """Pathy.(<.>) 6"""
|
, """Pathy.(<.>) 6"""
|
||||||
, """Pathy.(</>) 6"""
|
, """Pathy.(</>) 6"""
|
||||||
@ -336,6 +340,8 @@ defaultOperators =
|
|||||||
, """Prelude.(>>=) 1"""
|
, """Prelude.(>>=) 1"""
|
||||||
, """Prelude.(>>>) 9"""
|
, """Prelude.(>>>) 9"""
|
||||||
, """Prelude.(||) 2"""
|
, """Prelude.(||) 2"""
|
||||||
|
, """StringParser.(<?>) 4"""
|
||||||
|
, """StringParser.Combinators.(<?>) 4"""
|
||||||
, """Test.QuickCheck.(/==) 2"""
|
, """Test.QuickCheck.(/==) 2"""
|
||||||
, """Test.QuickCheck.(/=?) 2"""
|
, """Test.QuickCheck.(/=?) 2"""
|
||||||
, """Test.QuickCheck.(<=?) 2"""
|
, """Test.QuickCheck.(<=?) 2"""
|
||||||
@ -345,13 +351,7 @@ defaultOperators =
|
|||||||
, """Test.QuickCheck.(==?) 2"""
|
, """Test.QuickCheck.(==?) 2"""
|
||||||
, """Test.QuickCheck.(>=?) 2"""
|
, """Test.QuickCheck.(>=?) 2"""
|
||||||
, """Test.QuickCheck.(>?) 2"""
|
, """Test.QuickCheck.(>?) 2"""
|
||||||
, """Text.Parsing.Indent.(<*/>) 11"""
|
, """Type.Function.(#) type 1"""
|
||||||
, """Text.Parsing.Indent.(<+/>) 9"""
|
|
||||||
, """Text.Parsing.Indent.(<-/>) 10"""
|
|
||||||
, """Text.Parsing.Indent.(<?/>) 12"""
|
|
||||||
, """Text.Parsing.Parser.Combinators.(<?>) 3"""
|
|
||||||
, """Text.Parsing.Parser.Combinators.(<??>) 3"""
|
|
||||||
, """Text.Parsing.StringParser.Combinators.(<?>) 3"""
|
|
||||||
, """Type.Function.($) type 0"""
|
, """Type.Function.($) type 0"""
|
||||||
, """Type.Prelude.(+) type 0"""
|
, """Type.Prelude.(+) type 0"""
|
||||||
, """Type.Row.(+) type 0"""
|
, """Type.Row.(+) type 0"""
|
||||||
|
Loading…
Reference in New Issue
Block a user