diff --git a/src/NoUnusedExports.elm b/src/NoUnusedExports.elm index 7e21627a..4e6a8922 100644 --- a/src/NoUnusedExports.elm +++ b/src/NoUnusedExports.elm @@ -57,7 +57,7 @@ rule = schema |> Rule.withModuleDefinitionVisitor moduleDefinitionVisitor , initGlobalContext = initGlobalContext - , initModuleContext = initModuleContext + , fromGlobalToModule = fromGlobalToModule , fromModuleToGlobal = fromModuleToGlobal , fold = fold } @@ -97,8 +97,8 @@ initGlobalContext = } -initModuleContext : Rule.FileKey -> Node ModuleName -> GlobalContext -> ModuleContext -initModuleContext fileKey moduleNameNode globalContext = +fromGlobalToModule : Rule.FileKey -> Node ModuleName -> GlobalContext -> ModuleContext +fromGlobalToModule fileKey moduleNameNode globalContext = { exposesEverything = False , exposed = Dict.empty } diff --git a/src/NoUnusedModules.elm b/src/NoUnusedModules.elm index 6742b3e8..fbf9f3b0 100644 --- a/src/NoUnusedModules.elm +++ b/src/NoUnusedModules.elm @@ -50,7 +50,7 @@ rule = Rule.newMultiSchema "NoUnused.Modules" { moduleVisitorSchema = moduleVisitorSchema , initGlobalContext = initGlobalContext - , initModuleContext = initModuleContext + , fromGlobalToModule = fromGlobalToModule , fromModuleToGlobal = fromModuleToGlobal , fold = fold } @@ -89,8 +89,8 @@ initGlobalContext = } -initModuleContext : Rule.FileKey -> Node ModuleName -> GlobalContext -> ModuleContext -initModuleContext _ _ globalContext = +fromGlobalToModule : Rule.FileKey -> Node ModuleName -> GlobalContext -> ModuleContext +fromGlobalToModule _ _ globalContext = { importedModules = Set.empty , containsMainFunction = False , isPackage = globalContext.isPackage diff --git a/src/Review/Rule.elm b/src/Review/Rule.elm index dca605ab..b35b6852 100644 --- a/src/Review/Rule.elm +++ b/src/Review/Rule.elm @@ -549,7 +549,7 @@ type MultiSchema globalContext moduleContext { name : String , context : { initGlobalContext : globalContext - , initModuleContext : FileKey -> Node ModuleName -> globalContext -> moduleContext + , fromGlobalToModule : FileKey -> Node ModuleName -> globalContext -> moduleContext , fromModuleToGlobal : FileKey -> Node ModuleName -> moduleContext -> globalContext , fold : globalContext -> globalContext -> globalContext } @@ -571,17 +571,17 @@ newMultiSchema : -> { moduleVisitorSchema : Schema ForLookingAtSeveralFiles { hasNoVisitor : () } moduleContext -> Schema ForLookingAtSeveralFiles { hasAtLeastOneVisitor : () } moduleContext , initGlobalContext : globalContext - , initModuleContext : FileKey -> Node ModuleName -> globalContext -> moduleContext + , fromGlobalToModule : FileKey -> Node ModuleName -> globalContext -> moduleContext , fromModuleToGlobal : FileKey -> Node ModuleName -> moduleContext -> globalContext , fold : globalContext -> globalContext -> globalContext } -> MultiSchema globalContext moduleContext -newMultiSchema name_ { moduleVisitorSchema, initGlobalContext, initModuleContext, fromModuleToGlobal, fold } = +newMultiSchema name_ { moduleVisitorSchema, initGlobalContext, fromGlobalToModule, fromModuleToGlobal, fold } = MultiSchema { name = name_ , context = { initGlobalContext = initGlobalContext - , initModuleContext = initModuleContext + , fromGlobalToModule = fromGlobalToModule , fromModuleToGlobal = fromModuleToGlobal , fold = fold } @@ -670,7 +670,7 @@ allFilesInParallelTraversal (MultiSchema schema) startCache project = initialModuleContext : moduleContext initialModuleContext = - schema.context.initModuleContext + schema.context.fromGlobalToModule fileKey moduleNameNode_ initialContext @@ -790,7 +790,7 @@ importedModulesFirst (MultiSchema schema) startCache project = ) -- TODO Remove contexts from parents already handled by other parents |> List.foldl schema.context.fold initialContext - |> schema.context.initModuleContext fileKey moduleNameNode_ + |> schema.context.fromGlobalToModule fileKey moduleNameNode_ moduleVisitor : Schema ForLookingAtSeveralFiles { hasAtLeastOneVisitor : () } moduleContext moduleVisitor =