Do not fail with missing sources if there are modules added through the project

This commit is contained in:
Jeroen Engels 2020-04-08 16:31:04 +02:00
parent 591896492c
commit 17c9c0e30f

View File

@ -322,10 +322,6 @@ interested in project related details, then you should use [`runOnModules`](#run
-}
runOnModulesWithProjectData : Project -> Rule -> List String -> ReviewResult
runOnModulesWithProjectData project rule sources =
if List.isEmpty sources then
FailedRun ErrorMessage.missingSources
else
let
projectWithModules : Project
projectWithModules =
@ -355,6 +351,10 @@ runOnModulesWithProjectData project rule sources =
modules =
Project.modules projectWithModules
in
if List.isEmpty modules then
FailedRun ErrorMessage.missingSources
else
case findDuplicateModuleNames Set.empty modules of
Just moduleName ->
FailedRun <| ErrorMessage.duplicateModuleName moduleName