Give less useless details in NoUnused rules

This commit is contained in:
Jeroen Engels 2020-04-01 22:40:23 +02:00
parent 3d30a56cb0
commit 61aaf0f873
4 changed files with 2 additions and 12 deletions

View File

@ -481,11 +481,7 @@ finalProjectEvaluation projectContext =
errorInformation : Node String -> { message : String, details : List String }
errorInformation node =
{ message = "Type constructor `" ++ Node.value node ++ "` is not used."
, details =
[ "This type constructor is never used. It might be handled everywhere it might appear, but there is no location where this value actually gets created."
, "You should either use this value somewhere, or remove it at the location I pointed at."
, "If you remove it, you may find that other pieces of code are never used, and can themselves be removed too. This could end up simplifying your code a lot."
]
, details = [ "This type constructor is never used. It might be handled everywhere it might appear, but there is no location where this value actually gets created." ]
}

View File

@ -82,8 +82,6 @@ packageElmJson =
details : List String
details =
[ "This type constructor is never used. It might be handled everywhere it might appear, but there is no location where this value actually gets created."
, "You should either use this value somewhere, or remove it at the location I pointed at."
, "If you remove it, you may find that other pieces of code are never used, and can themselves be removed too. This could end up simplifying your code a lot."
]

View File

@ -13,7 +13,6 @@ testRule =
details : List String
details =
[ "You should either use this value somewhere, or remove it at the location I pointed at."
, "If you remove it, you may find that other pieces of code are never used, and can themselves be removed too. This could end up simplifying your code a lot."
]

View File

@ -132,10 +132,7 @@ error : Dict String VariableInfo -> VariableInfo -> String -> Error {}
error declaredModules variableInfo name =
Rule.error
{ message = variableTypeToString variableInfo.variableType ++ " `" ++ name ++ "` is not used" ++ variableTypeWarning variableInfo.variableType
, details =
[ "You should either use this value somewhere, or remove it at the location I pointed at."
, "If you remove it, you may find that other pieces of code are never used, and can themselves be removed too. This could end up simplifying your code a lot."
]
, details = [ "You should either use this value somewhere, or remove it at the location I pointed at." ]
}
variableInfo.under
|> addFix declaredModules variableInfo