Improve reviewV2's error message too

This commit is contained in:
Jeroen Engels 2021-03-01 19:44:20 +01:00
parent e4df0e01ee
commit cb6c13e645

View File

@ -558,18 +558,15 @@ getModulesSortedByImport project =
findCycle moduleGraph edge
|> List.reverse
in
[ Review.Error.ReviewError
{ filePath = "GLOBAL ERROR"
, ruleName = "Incorrect project"
, message = "Import cycle discovered"
[ globalError
{ message = "Your module imports form a cycle:"
, details =
[ "I detected an import cycle in your project. This prevents me from working correctly, and results in a error for the Elm compiler anyway. Please resolve it using the compiler's suggestions, then try running `elm-review` again."
[ "Learn more about why this is disallowed and how to break cycles here:<https://elm-lang.org/0.19.1/import-cycles>"
, printCycle cycle
]
, range = { start = { row = 0, column = 0 }, end = { row = 0, column = 0 } }
, fixes = Nothing
, target = Review.Error.Global
}
|> setRuleName "Incorrect project"
|> errorToReviewError
]
)
sortedModules