mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-10-26 16:10:55 +03:00
Turn extra files into a Dict String String
This commit is contained in:
parent
c2440e5644
commit
757ebb6b5e
@ -334,11 +334,11 @@ addExtraFiles files (Internal.Project project) =
|
||||
}
|
||||
|
||||
|
||||
{-| Get the list of extra files in the project.
|
||||
{-| Get the extra files in the project.
|
||||
-}
|
||||
extraFiles : Project -> List { path : String, content : String }
|
||||
extraFiles : Project -> Dict String String
|
||||
extraFiles (Internal.Project project) =
|
||||
List.map Tuple.first project.extraFiles
|
||||
project.extraFiles2
|
||||
|
||||
|
||||
{-| Add a dependency to the project. These will be available for rules to make
|
||||
|
@ -547,18 +547,16 @@ readmeRunResult errors project =
|
||||
extraFileRunResult : List ReviewError -> Project -> List SuccessfulRunResult
|
||||
extraFileRunResult errors project =
|
||||
let
|
||||
extraFilePaths : Dict String { path : String, content : String }
|
||||
extraFilePaths : Dict String String
|
||||
extraFilePaths =
|
||||
Project.extraFiles project
|
||||
|> List.map (\file -> ( file.path, file ))
|
||||
|> Dict.fromList
|
||||
in
|
||||
Dict.foldl
|
||||
(\path errorsForFile acc ->
|
||||
case Dict.get path extraFilePaths of
|
||||
Just file ->
|
||||
Just content ->
|
||||
{ moduleName = path
|
||||
, inspector = codeInspectorForSource False file.content
|
||||
, inspector = codeInspectorForSource False content
|
||||
, errors = errorsForFile
|
||||
}
|
||||
:: acc
|
||||
|
Loading…
Reference in New Issue
Block a user