mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Report configuration error
This commit is contained in:
parent
5d64d1073e
commit
9f34b4cba7
@ -1327,10 +1327,15 @@ fromProjectRuleSchema (ProjectRuleSchema schema) =
|
||||
)
|
||||
}
|
||||
|
||||
Err _ ->
|
||||
Err faultyGlobs ->
|
||||
configurationError schema.name
|
||||
{ message = "Invalid globs provided"
|
||||
, details = [ "Globs bad" ]
|
||||
{ message = "Invalid globs provided when requesting extra files"
|
||||
, details =
|
||||
[ "This rule requested additional files, but did so by specifying globs that I could not make sense of:"
|
||||
, faultyGlobs
|
||||
|> List.indexedMap (\index glob -> " " ++ String.fromInt (index + 1) ++ ". " ++ glob)
|
||||
|> String.join "\n"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,12 +90,15 @@ a = 1
|
||||
\() ->
|
||||
createRule
|
||||
(Rule.withExtraFilesModuleVisitor
|
||||
[ " ** " ]
|
||||
[ "** " ]
|
||||
(reportsFileNames "A")
|
||||
)
|
||||
|> Review.Test.expectConfigurationError
|
||||
{ message = "err"
|
||||
, details = [ "details" ]
|
||||
{ message = "Invalid globs provided when requesting extra files"
|
||||
, details =
|
||||
[ "This rule requested additional files, but did so by specifying globs that I could not make sense of:"
|
||||
, " 1. ** "
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user