mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-22 13:15:59 +03:00
Update the demo to work with recent API changes
This commit is contained in:
parent
b654daa301
commit
4b2ce76584
@ -10,7 +10,7 @@ import NoUnused.Variables
|
||||
import Reporter
|
||||
import Review
|
||||
import Review.File exposing (RawFile)
|
||||
import Review.Project as Project
|
||||
import Review.Project as Project exposing (Project)
|
||||
import Review.Rule as Rule exposing (Rule)
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ main =
|
||||
|
||||
type alias Model =
|
||||
{ sourceCode : String
|
||||
, project : Project
|
||||
, reviewErrors : List Rule.Error
|
||||
, noDebugEnabled : Bool
|
||||
, noUnusedVariablesEnabled : Bool
|
||||
@ -66,6 +67,7 @@ g n = n + 1
|
||||
"""
|
||||
in
|
||||
{ sourceCode = sourceCode
|
||||
, project = Project.withModule (file sourceCode) Project.new
|
||||
, reviewErrors = []
|
||||
, noDebugEnabled = True
|
||||
, noUnusedVariablesEnabled = True
|
||||
@ -105,7 +107,10 @@ update : Msg -> Model -> Model
|
||||
update action model =
|
||||
case action of
|
||||
UserEditedSourceCode sourceCode ->
|
||||
{ model | sourceCode = sourceCode }
|
||||
{ model
|
||||
| sourceCode = sourceCode
|
||||
, project = Project.withModule (file sourceCode) model.project
|
||||
}
|
||||
|> runReview
|
||||
|
||||
UserToggledNoDebugRule ->
|
||||
@ -126,7 +131,11 @@ update action model =
|
||||
|
||||
runReview : Model -> Model
|
||||
runReview model =
|
||||
{ model | reviewErrors = Review.reviewRawFiles (config model) Project.new [ file model.sourceCode ] }
|
||||
{ model
|
||||
| reviewErrors =
|
||||
Review.review (config model) model.project
|
||||
|> Tuple.first
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -14,10 +14,13 @@
|
||||
"elm/core": "1.0.2",
|
||||
"elm/html": "1.0.0",
|
||||
"elm/project-metadata-utils": "1.0.0",
|
||||
"elm-community/graph": "6.0.0",
|
||||
"elm-community/intdict": "3.0.0",
|
||||
"jinjor/elm-diff": "1.0.6",
|
||||
"stil4m/elm-syntax": "7.1.0"
|
||||
},
|
||||
"indirect": {
|
||||
"avh4/elm-fifo": "1.0.4",
|
||||
"elm/json": "1.1.3",
|
||||
"elm/parser": "1.1.0",
|
||||
"elm/time": "1.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user