mirror of
https://github.com/jfmengels/elm-review.git
synced 2025-01-08 02:36:26 +03:00
Add helper to parse elm.json files
This commit is contained in:
parent
6019524a87
commit
084b8d3860
@ -343,10 +343,7 @@ runWithOptions rule project buildOptions =
|
||||
|
||||
applicationElmJson : String -> { path : String, raw : String, project : Elm.Project.Project }
|
||||
applicationElmJson depsDirectString =
|
||||
let
|
||||
raw : String
|
||||
raw =
|
||||
"""{
|
||||
parseElmJson ("""{
|
||||
"type": "application",
|
||||
"source-directories": [
|
||||
"src"
|
||||
@ -363,8 +360,11 @@ applicationElmJson depsDirectString =
|
||||
"indirect": {}
|
||||
}
|
||||
}
|
||||
"""
|
||||
in
|
||||
""")
|
||||
|
||||
|
||||
parseElmJson : String -> { path : String, raw : String, project : Elm.Project.Project }
|
||||
parseElmJson raw =
|
||||
case Decode.decodeString Elm.Project.decoder raw of
|
||||
Ok project ->
|
||||
{ path = "elm.json"
|
||||
|
Loading…
Reference in New Issue
Block a user