mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-26 03:04:48 +03:00
Rename withProjectDependenciesVisitor to withDependenciesProjectVisitor
This commit is contained in:
parent
5cfd68fb6b
commit
13bed263d0
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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 }
|
||||||
|
Loading…
Reference in New Issue
Block a user