Rename withProjectDependenciesVisitor to withDependenciesProjectVisitor

This commit is contained in:
Jeroen Engels 2020-03-02 22:54:22 +01:00
parent 5cfd68fb6b
commit 13bed263d0
4 changed files with 10 additions and 10 deletions

View File

@ -41,7 +41,7 @@ rule configuration =
, foldProjectContexts = foldProjectContexts , foldProjectContexts = foldProjectContexts
} }
|> Rule.withElmJsonProjectVisitor elmJsonVisitor |> Rule.withElmJsonProjectVisitor elmJsonVisitor
|> Rule.withProjectDependenciesVisitor dependenciesVisitor |> Rule.withDependenciesProjectVisitor dependenciesVisitor
|> Rule.withFinalProjectEvaluation (finalEvaluationForProject configuration) |> Rule.withFinalProjectEvaluation (finalEvaluationForProject configuration)
|> Rule.fromProjectRuleSchema |> Rule.fromProjectRuleSchema

View File

@ -54,7 +54,7 @@ rule =
, foldProjectContexts = foldProjectContexts , foldProjectContexts = foldProjectContexts
} }
|> Rule.withElmJsonProjectVisitor elmJsonVisitor |> Rule.withElmJsonProjectVisitor elmJsonVisitor
|> Rule.withProjectDependenciesVisitor dependenciesVisitor |> Rule.withDependenciesProjectVisitor dependenciesVisitor
|> Rule.withFinalProjectEvaluation finalEvaluationForProject |> Rule.withFinalProjectEvaluation finalEvaluationForProject
|> Rule.fromProjectRuleSchema |> Rule.fromProjectRuleSchema

View File

@ -5,7 +5,7 @@ module Review.Rule exposing
, withSimpleModuleDefinitionVisitor, withSimpleCommentsVisitor, withSimpleImportVisitor, withSimpleDeclarationVisitor, withSimpleExpressionVisitor , withSimpleModuleDefinitionVisitor, withSimpleCommentsVisitor, withSimpleImportVisitor, withSimpleDeclarationVisitor, withSimpleExpressionVisitor
, withModuleDefinitionVisitor, withCommentsVisitor, withImportVisitor, Direction(..), withDeclarationVisitor, withDeclarationListVisitor, withExpressionVisitor, withFinalModuleEvaluation , withModuleDefinitionVisitor, withCommentsVisitor, withImportVisitor, Direction(..), withDeclarationVisitor, withDeclarationListVisitor, withExpressionVisitor, withFinalModuleEvaluation
, withElmJsonModuleVisitor, withDependenciesModuleVisitor , withElmJsonModuleVisitor, withDependenciesModuleVisitor
, ProjectRuleSchema, newProjectRuleSchema, fromProjectRuleSchema, withElmJsonProjectVisitor, withProjectDependenciesVisitor, withFinalProjectEvaluation, withContextFromImportedModules , ProjectRuleSchema, newProjectRuleSchema, fromProjectRuleSchema, withElmJsonProjectVisitor, withDependenciesProjectVisitor, withFinalProjectEvaluation, withContextFromImportedModules
, Error, error, errorRuleName, errorMessage, errorDetails, errorRange, errorFixes, errorFilePath, ModuleKey, errorForFile, ElmJsonKey, errorForElmJson , Error, error, errorRuleName, errorMessage, errorDetails, errorRange, errorFixes, errorFilePath, ModuleKey, errorForFile, ElmJsonKey, errorForElmJson
, withFixes , withFixes
, ignoreErrorsForDirectories, ignoreErrorsForFiles , ignoreErrorsForDirectories, ignoreErrorsForFiles
@ -189,7 +189,7 @@ Evaluating/visiting a node means two things:
## Creating a project rule ## Creating a project rule
@docs ProjectRuleSchema, newProjectRuleSchema, fromProjectRuleSchema, withElmJsonProjectVisitor, withProjectDependenciesVisitor, withFinalProjectEvaluation, withContextFromImportedModules @docs ProjectRuleSchema, newProjectRuleSchema, fromProjectRuleSchema, withElmJsonProjectVisitor, withDependenciesProjectVisitor, withFinalProjectEvaluation, withContextFromImportedModules
## Errors ## Errors
@ -776,7 +776,7 @@ same visitors as for module rules. The exception are the following visitors, whi
are replaced by functions that you need to use on the project rule schema. are replaced by functions that you need to use on the project rule schema.
- [`withElmJsonModuleVisitor`](#withElmJsonModuleVisitor), replaced by [`withElmJsonProjectVisitor`](#withElmJsonProjectVisitor) - [`withElmJsonModuleVisitor`](#withElmJsonModuleVisitor), replaced by [`withElmJsonProjectVisitor`](#withElmJsonProjectVisitor)
- [`withDependenciesModuleVisitor`](#withDependenciesModuleVisitor), replaced by [`withProjectDependenciesVisitor`](#withProjectDependenciesVisitor) - [`withDependenciesModuleVisitor`](#withDependenciesModuleVisitor), replaced by [`withDependenciesProjectVisitor`](#withDependenciesProjectVisitor)
- [`withFinalModuleEvaluation`](#withFinalModuleEvaluation), replaced by [`withFinalProjectEvaluation`](#withFinalProjectEvaluation) - [`withFinalModuleEvaluation`](#withFinalModuleEvaluation), replaced by [`withFinalProjectEvaluation`](#withFinalProjectEvaluation)
Let's look at the data that we will be working with. Let's look at the data that we will be working with.
@ -899,7 +899,7 @@ Before looking at modules...TODO
- A final evaluation is made when the module has fully been visited, using [`withFinalModuleEvaluation`](#withFinalModuleEvaluation) - A final evaluation is made when the module has fully been visited, using [`withFinalModuleEvaluation`](#withFinalModuleEvaluation)
You can't use [`withElmJsonModuleVisitor`](#withElmJsonModuleVisitor) or [`withDependenciesModuleVisitor`](#withDependenciesModuleVisitor) You can't use [`withElmJsonModuleVisitor`](#withElmJsonModuleVisitor) or [`withDependenciesModuleVisitor`](#withDependenciesModuleVisitor)
in project rules. Instead, you should use [`withElmJsonProjectVisitor`](#withElmJsonProjectVisitor) or [`withProjectDependenciesVisitor`](#withProjectDependenciesVisitor). in project rules. Instead, you should use [`withElmJsonProjectVisitor`](#withElmJsonProjectVisitor) or [`withDependenciesProjectVisitor`](#withDependenciesProjectVisitor).
-} -}
newProjectRuleSchema : newProjectRuleSchema :
@ -959,11 +959,11 @@ withElmJsonProjectVisitor visitor (ProjectRuleSchema schema) =
{-| TODO documentation {-| TODO documentation
-} -}
withProjectDependenciesVisitor : withDependenciesProjectVisitor :
(Dict String Review.Project.Dependency -> projectContext -> projectContext) (Dict String Review.Project.Dependency -> projectContext -> projectContext)
-> ProjectRuleSchema projectContext moduleContext -> ProjectRuleSchema projectContext moduleContext
-> ProjectRuleSchema projectContext moduleContext -> ProjectRuleSchema projectContext moduleContext
withProjectDependenciesVisitor visitor (ProjectRuleSchema schema) = withDependenciesProjectVisitor visitor (ProjectRuleSchema schema) =
ProjectRuleSchema { schema | dependenciesVisitors = visitor :: schema.dependenciesVisitors } ProjectRuleSchema { schema | dependenciesVisitors = visitor :: schema.dependenciesVisitors }
@ -985,7 +985,7 @@ When you finish analyzing a module, the `moduleContext` is turned into a `projec
through [`fromModuleToProject`](#newProjectRuleSchema). Before analyzing a file, through [`fromModuleToProject`](#newProjectRuleSchema). Before analyzing a file,
the `projectContext`s of its imported modules get folded into a single one the `projectContext`s of its imported modules get folded into a single one
starting with the initial context (that may have visited the starting with the initial context (that may have visited the
[`elm.json` file](#withElmJsonProjectVisitor) and/or the [project's dependencies](#withProjectDependenciesVisitor)) [`elm.json` file](#withElmJsonProjectVisitor) and/or the [project's dependencies](#withDependenciesProjectVisitor))
using [`foldProjectContexts`](#newProjectRuleSchema). using [`foldProjectContexts`](#newProjectRuleSchema).
If there is information about another module that you wish to access, you should If there is information about another module that you wish to access, you should

View File

@ -174,7 +174,7 @@ addProjectVisitors : Rule.ProjectRuleSchema { projectContext | scope : ProjectCo
addProjectVisitors schema = addProjectVisitors schema =
schema schema
|> Rule.withContextFromImportedModules |> Rule.withContextFromImportedModules
|> Rule.withProjectDependenciesVisitor (mapInnerProjectContext dependenciesVisitor) |> Rule.withDependenciesProjectVisitor (mapInnerProjectContext dependenciesVisitor)
addModuleVisitors : Rule.ModuleRuleSchema anything { moduleContext | scope : ModuleContext } -> Rule.ModuleRuleSchema { anything | hasAtLeastOneVisitor : () } { moduleContext | scope : ModuleContext } addModuleVisitors : Rule.ModuleRuleSchema anything { moduleContext | scope : ModuleContext } -> Rule.ModuleRuleSchema { anything | hasAtLeastOneVisitor : () } { moduleContext | scope : ModuleContext }