Update demo example

This commit is contained in:
Jeroen Engels 2020-04-08 19:30:33 +02:00
parent 530eebb4b1
commit 188967870f

View File

@ -4,7 +4,8 @@ import Browser
import Html exposing (Html, button, div, input, label, p, text, textarea) import Html exposing (Html, button, div, input, label, p, text, textarea)
import Html.Attributes as Attr import Html.Attributes as Attr
import Html.Events as Events import Html.Events as Events
import NoDebug import NoDebug.Log
import NoDebug.TodoOrToString
import NoUnused.CustomTypeConstructors import NoUnused.CustomTypeConstructors
import NoUnused.Variables import NoUnused.Variables
import Reporter import Reporter
@ -81,9 +82,10 @@ g n = n + 1
config : Model -> List Rule config : Model -> List Rule
config model = config model =
[ ( model.noDebugEnabled, NoDebug.rule ) [ ( model.noDebugEnabled, NoDebug.Log.rule )
, ( model.noDebugEnabled, NoDebug.TodoOrToString.rule )
, ( model.noUnusedVariablesEnabled, NoUnused.Variables.rule ) , ( model.noUnusedVariablesEnabled, NoUnused.Variables.rule )
, ( model.noUnusedTypeConstructorsEnabled, NoUnused.CustomTypeConstructors.rule ) , ( model.noUnusedTypeConstructorsEnabled, NoUnused.CustomTypeConstructors.rule [] )
] ]
|> List.filter Tuple.first |> List.filter Tuple.first
|> List.map Tuple.second |> List.map Tuple.second
@ -195,9 +197,9 @@ viewConfigurationPanel model =
[ Attr.style "display" "flex" [ Attr.style "display" "flex"
, Attr.style "flex-direction" "column" , Attr.style "flex-direction" "column"
] ]
[ viewCheckbox UserToggledNoDebugRule "NoDebug" model.noDebugEnabled [ viewCheckbox UserToggledNoDebugRule "NoDebug rules" model.noDebugEnabled
, viewCheckbox UserToggledNoUnusedVariablesRule "NoUnusedVariables" model.noUnusedVariablesEnabled , viewCheckbox UserToggledNoUnusedVariablesRule "NoUnused.Variables" model.noUnusedVariablesEnabled
, viewCheckbox UserToggledNoUnusedTypeConstructorsRule "NoUnusedTypeConstructors" model.noUnusedTypeConstructorsEnabled , viewCheckbox UserToggledNoUnusedTypeConstructorsRule "NoUnused.CustomTypeConstructors" model.noUnusedTypeConstructorsEnabled
] ]
] ]
@ -237,8 +239,13 @@ configurationAsText model =
rules : List { import_ : String, configExpression : String } rules : List { import_ : String, configExpression : String }
rules = rules =
[ ( model.noDebugEnabled [ ( model.noDebugEnabled
, { import_ = "NoDebug" , { import_ = "NoDebug.Log"
, configExpression = "NoDebug.rule" , configExpression = "NoDebug.Log.rule"
}
)
, ( model.noDebugEnabled
, { import_ = "NoDebug.TodoOrToString"
, configExpression = "NoDebug.TodoOrToString.rule"
} }
) )
, ( model.noUnusedVariablesEnabled , ( model.noUnusedVariablesEnabled
@ -248,7 +255,7 @@ configurationAsText model =
) )
, ( model.noUnusedTypeConstructorsEnabled , ( model.noUnusedTypeConstructorsEnabled
, { import_ = "NoUnused.CustomTypeConstructors" , { import_ = "NoUnused.CustomTypeConstructors"
, configExpression = "NoUnused.CustomTypeConstructors.rule" , configExpression = "NoUnused.CustomTypeConstructors.rule []"
} }
) )
] ]